FORUMS
Remove All Ads from XDA

[APP] micro-httpd (GET / POST / CGI support) cross-compiled to Android

407 posts
Thanks Meter: 396
 
By viulian, Recognized Developer on 28th August 2011, 02:42 PM
Post Reply Email Thread
Hello,

A while ago I've managed to cross-compile a basic web server, resulting in a native ARM executable (you can find it here) that allows any other device to connect to port 80 (or whatever) and browse the contents of the phone.
Easy to exchange photos at a cafeteria which has wifi and both phones are connected - for example. No need for an FTP client, slow bluetooth, and so on...

However, I wanted more and since webserver was only handling GET (no POST / no CGI), I've started looking for an alternative that did the job.

Below, you will find a native ARM executable of micro-httpd, a light weight web server that supports CGI.

Download

Use it at your own risk!


mini_httpd_1.19.arm.tar.gz


It supports .htpasswd files to restrict access to folders - and it comes also with its own utility htpasswd which manipulates the password files.

micro-httpd website: http://www.acme.com/software/mini_httpd/
micro-httpd configuration options: http://manpages.ubuntu.com/manpages/...i-httpd.8.html

You can use almost any CGI interpreter you want, minus PHP. The PHP 4 Android (a native implementation of PHP) has only CLI (command line support) and even if you could change the PHP code of the scripts to output the missing headers. BUT! It also outputs debug messages that you cannot control, in the output of the script!

Those messages are are considered errors in HTTP / CGI.
The creators of PHP interpreter say that is only meant for Scripting Languages for Android (SL4A) which works with what they have. You can read more here: http://groups.google.com/group/php-f...56189675?pli=1. This topic also mentions an alternative (CGI this time) from GroomDroid but that is also unstable.

Enter PERL!

I had good success with Perl 4 Android

I can how host a blog on my phone - I've set up a big tutorial on how to configure everything here Running native CGI scripts (perl) with micro-httpd on Android.

Result



Next step would be to try out a file manager and test file upload, then go even deeper to see if I can access various phone details and offer a sort of management interface for them on the web.

Source code

You will find the source code and the license (free) on the tutorial website above.
The Following 3 Users Say Thank You to viulian For This Useful Post: [ View ]
 
 
28th August 2011, 04:47 PM |#2  
cdesai's Avatar
Recognized Developer
Flag IN YOUR HEAD
Thanks Meter: 4,122
 
Donate to Me
More
Seems interesting !
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes