Environment variables such as DOCUMENT_ROOT

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Environment variables such as DOCUMENT_ROOT

Postby ThinkingMan » Sun Apr 02, 2017 1:12 am

Does chromium embedded have anything like apache's "DOCUMENT_ROOT" and other environment variables.. such as HTTP_REFERER, QUERY_STRING, HTTP_USER_AGENT and many others. If some of these variables were implemented, theoretically many online cgi programs could now work offline. I am thinking about ways to fake them so that online cgi programs that rely on them, would also work offline. But maybe chromium embedded already has something like this.

Imagine being able to take any cgi program written 1-10 years ago and make it work offline with no http required. That's my aim. Some cgi programs rely on these variables. Plain simple cgi programs that do not rely on these variables will work fairly easily AFAICT, but anything that relies on something like SCRIPT_NAME.

Possible solutions if chromium embedded does not have any of this implemented:
-set up some SetEnv's to emulate apache, since AFAIK apache cgi programs just make a call to GetEnv to obtain these
-as an example, DOCUMENT_ROOT could be set to some fixed directory where all html files will be loaded from, similar to public_html on an apache server

This would mean that any cgi program, written 10 years ago, or 3 years ago, or whenever, could theoretically work offline without http and no port 80. That would be pretty cool. Not sure if I am missing anything that would not allow this idea to work, there may in fact be something I can't think of that would break a cgi program other than these server environment variables.

And, maybe someone has already thought of this idea and has a chromium offline web program loader, who knows..
ThinkingMan
Techie
 
Posts: 10
Joined: Wed Mar 01, 2017 11:52 am

Re: Environment variables such as DOCUMENT_ROOT

Postby amaitland » Sun Apr 02, 2017 5:56 am

You'll have to implement your own CGI interface.

Read the general usage guide on the wiki, you can implement a scheme handler to process the requests.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 22 guests