20,741
edits
(Created page with " {{DeQuote}} == Background == {{FGCquote |It runs on any device that has a web browser. So yes, if your FlightGear <br/> computer can run Firefox, Opera or alike you can ru...") |
No edit summary |
||
| Line 3: | Line 3: | ||
== Background == | == Background == | ||
{{FGCquote | |||
|while working on the new radio/atis implementation, I rediscovered the <br/> | |||
internal httpd (aka webserver) to browse the property tree.<br/> | |||
It's much easier to have multiple browser windows open and point to <br/> | |||
various locations in the property tree than to reopen the internal <br/> | |||
property browser and navigate to the locations after each sim restart. | |||
|{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32068663/ | |||
|title=<nowiki>[Flightgear-devel] FlightGear goes web 2.0</nowiki> | |||
|author=<nowiki>Torsten Dreyer</nowiki> | |||
|date=<nowiki>2014-03-06</nowiki> | |||
}} | |||
}} | |||
{{FGCquote | |||
|After a while, I got disappointed by the functionality and the look&feel <br/> | |||
of the http property-browser, so i had a look at the code to see if it <br/> | |||
could be improved. I quickly realized, that the implementation was <br/> | |||
simple but not scalable, so I looked for something allready available on <br/> | |||
the GPL market.<br/> | |||
I found Mongoose as a well maintained, feature rich and yet simple <br/> | |||
implementation of a web server and started to embedd that into FlightGear. | |||
|{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32068663/ | |||
|title=<nowiki>[Flightgear-devel] FlightGear goes web 2.0</nowiki> | |||
|author=<nowiki>Torsten Dreyer</nowiki> | |||
|date=<nowiki>2014-03-06</nowiki> | |||
}} | |||
}} | |||
{{FGCquote | |||
|What I have ready so far and just pushed to next is:<br/> | |||
- A single threaded httpd running in the main loop (should probably get <br/> | |||
it's own thread soon)<br/> | |||
- Running as a replacement for the old httpd<br/> | |||
- Serving FGDATA/Docs as the document root<br/> | |||
- Serving the uri /props/ as a replacement for the old property browser <br/> | |||
(improved functionality, improved l&f, styling via css)<br/> | |||
- Serving the uri /run.cgi as a replacement for the old interface to run <br/> | |||
fg_commands<br/> | |||
- Serving the uri /json/ to return selected properties as JSON <br/> | |||
(read-only so far) | |||
|{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32068663/ | |||
|title=<nowiki>[Flightgear-devel] FlightGear goes web 2.0</nowiki> | |||
|author=<nowiki>Torsten Dreyer</nowiki> | |||
|date=<nowiki>2014-03-06</nowiki> | |||
}} | |||
}} | |||
{{FGCquote | |||
|I think this all has a lot of potential. With the JSON interface <br/> | |||
extended to being able to write properties, the CGI interface of <br/> | |||
Mongoose turned on, the webserver running stable in it's own thread, It <br/> | |||
should be possible to run e.g. PHP with jQuery or dojo.<br/> | |||
<br/> | |||
If you want to test the new functions, goto<br/> | |||
http://localhost:<httpd-port>/ for FGDATA/Docs<br/> | |||
http://localhost:<httpd-port>/props/ for the internal property browser<br/> | |||
http://localhost:<httpd-port>/json/some/property/name/or/path for the <br/> | |||
internal property browser<br/> | |||
http://localhost:<httpd-port>/run.cgi?value=pause to pause/unpause the <br/> | |||
simulation<br/> | |||
<br/> | |||
Please mind the trailing slash for /props/ and /json/ (no, it's not <br/> | |||
bug-free yet.) | |||
|{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32068663/ | |||
|title=<nowiki>[Flightgear-devel] FlightGear goes web 2.0</nowiki> | |||
|author=<nowiki>Torsten Dreyer</nowiki> | |||
|date=<nowiki>2014-03-06</nowiki> | |||
}} | |||
}} | |||
{{FGCquote | {{FGCquote | ||
|It runs on any device that has a web browser. So yes, if your FlightGear <br/> | |It runs on any device that has a web browser. So yes, if your FlightGear <br/> | ||