GNU httptunnel with CGI
I wrote this patch for GNU httptunnel 3.0.5. this adds the following functionalities :
- HTTP Basic Authentication : Allows to authenticate against a firewall or a Web server
- CGI options : For the client htc : allows to specify a cgi-script URI. For the server hts : don't send the HTTP return code (which must be sent only by the web server).
The server hts cannot be called directly by the web server because it must ensure a persistence with its input-outputs. The idea is to use a small cgi which makes the interface between hts and the web server. I wrote a small script in python which makes this job: tun.py but it is simple to do one in C
- On the server, copy tun.py to the cgi-bin directory. Start hts in cgi mode (-C or --cgi), listen to port 8888 and forward connexions to local port ssh (22) :
- hts -C -F localhost:22 8888
- On the client, start htc in cgi mode provinding URI to tun.py (-C URI or --cgi URI). In the following example webserver must be the name of the web server (IP address resolution must be possible). This name is also used in the HTTP headers sent by htc and makes it possible to select different virtual hosts.
- htc -C "/cgi-bin/tun.py" -F 2222 webserver:80
- If authentication (only Basic) is required to reach the cgi script, you can specify login:password on the htc command line :
- htc -C "/cgi-bin/tun.py" -a david:noway -F 2222 webserver:80