GNU HTTP Tunnel for S60

«»


The original GNU HTTP Tunnel is highly tunable, and while you don’t use the new features I added, this port is 100% compatible with previous versions.

So, for compatibility mode, don’t use :

  • —authorization,-n
  • —chunked,-C
  • —with-ack,-K
  • —retry-timeout,-R
  • —max-client,-n (server only)

Here’s the full list of options available :

Server options


Client options


Mail reader example

Here’s a minimalistic example on how to retrieve your messages from your Gmail account using POP through your tunnel. I used debug switch (-D) for verbosity, and chunked encoding (no proxy) :

> hts -C -D4 -F pop.gmail.com:25 80


import e32
# Start tunnel, less verbose, listening on local port 25,
e32.start(‘htc60.exe’,‘-C -D2 -F 25 myserver.dyndns.org:80′)


Then, on your phone, set the POP server from your favorite mail application to 127.0.0.1, that’s all !

There’s another interesting feature I added : the client can remotely tell the server which host/port data have to be forwarded to. Doing so, your tunnel is more ‘versatile’. Following the example above, it gives :


/* simply start the server w/ the -F switch */
> hts -C 80


import e32
# Start tunnel, listening on local port 25,
# remotely forward to gmail POP service through the tunnel
e32.start(‘htc60.exe’,‘-C -D2 -F 25,pop.gmail.com:25′
‘myserver.dyndns.org:80′)



Full mail example

The original version doesn’t enable multiple client support. Thanks to cookies (and multi-threading) you can now use as many tunnel as you need. Let’s see a full pop+smtp forwarding :


/* start server, no default forwarder, allow 10 clients*/
> hts -C -n10 80


import e32
# Two tunnels are needed for fully working mail #
# Start SMTP tunnel, listening on local port 110
e32.start(‘htc60.exe’,‘-C -F 110,smtp.gmail.com:110′
‘myserver.dyndns.org:80′)
# Start POP tunnel, listening on local port 25
e32.start(‘htc60.exe’,‘-C -F 25,pop.gmail.com:25′
‘myserver.dyndns.org:80′)



Chunked encoding « 1 2 3 4 5 6 » GUI front end



44 comments so far

Hi Biloute,

Good job !

You write weirdly, you’re cockeyed :) It isn’t Ch’ti Mi language. I don’t understand !!!

You don’t drink the good beer.

A Nosteke !

Bebert
April 1st, 2008 at 9:33 pm

[...] | GNU HTTP Tunnel for S60 trackback ¿Recomendarías este post? Más noticias sobre: Desarrollo, Aplicaciones [...]

GNU HTTP Tunnel para los S60
April 9th, 2008 at 11:47 am

Quick question, did the proxy used by the network operators allow for https connections or not?

Theo
April 19th, 2008 at 9:08 pm

Quick answer: yes.
I heard about the CONNECT method, but this hack isn’t working in most cases.

Renaud
April 20th, 2008 at 8:54 pm

The new features that you have developed are very interesting. Have you presented your work to Lars Brinkhoff? He maybe interested!

Christophe
October 14th, 2008 at 9:05 pm

I did, but I never get an answer…

Renaud
October 15th, 2008 at 8:39 am

Hum … might need to try again ;-)

May I suggest new features:
- On the client side:
. the possibility for users to specify a prefix to the URL of the POST requests
. the possibility for users to pass a list of cookies (a bit like curl –cookie )

[WEBMASTER: done !]

Indeed, some http-proxy (e.g. web appliance cisco 3000) rewrite on the fly URLs of http document they relay, and install their own cookies…

- On the server side:
. integrate a mini-html file server, in response to GET requests. The final idea would be to offer the client as a Java applet (as Xvnc -httpd ) (I believe it would fundamentally not possible that hts be launched by an HTTP server as a cgi. We should do the opposite.)

Regards

Christophe
October 15th, 2008 at 3:08 pm

doesnt work on n95 8gb? everythings installed but when i click on the icon it shuts right down. please help! i’ve been searching for a http tunnelling program for my n95 that actually works for over a week now. thanks! nice blog btw.

wildbill1996
October 31st, 2008 at 2:46 am

It should work on N95 too ! To make the GUI works, you first have to install Python for S60, OPEN C librairies (PIPS & Glib), and of course the GNU HTTP Tunnel client binary. Do you ?

Renaud
October 31st, 2008 at 9:22 am

yes i did install everything. i already had pips and pipes installed from another program. i downloaded the others from here. it acts like it was to start; ie: screen flickers like its changing to the application. then it just goes back to the applications menu. im going to continue messing with it. this is the second port forwarding app i have found that looks promising. but also the second that i havent been able to even run properly. it sucks that putty doesnt support port forwarding. thanks!!

wildbill1996
November 1st, 2008 at 2:38 am

Hi,

After some fiddling, I got your patched HTTPTunnel client/server to compile under MacOS X.

The original, unpatched HTTPTunnel source did compile, but after patching it, it didn’t, it returned the error: “Undefined symbols: _strndup”

I don’t know much about C, but I googled for a solution and found this related bug on other app: https://savannah.gnu.org/bugs/?24380 so after adding that code to tunnel.c, it compiled properly.

You can get the patch file (apply it to the already patched HTTPTunnel from the patch of this post) here:
http://dl.getdropbox.com/u/255615/patch-httptunnel-osx

And, some already compiled binaries, Intel-only AFAIK (I don’t know how to make universal binaries):
http://dl.getdropbox.com/u/255615/httptunnel-3.0.5-patched-osx.zip

To compile, after applying both patches, run:
./configure; automake -a -c; make
(requires XCode installed)

Now I’ll just wait until I get my N73 to try the Symbian part :)

zenìtraM
November 1st, 2008 at 12:32 pm

I am sorry but i have the same problem on my N95-8GB.
It seems to be from the line number 3.
“Import threading” doesn’t work. I think a library is missing.

plici_stephanet
November 2nd, 2008 at 9:24 pm

Thank you for reporting. I added the missing module to the installer. First uninstall the previous release, and it works now ! Even on N95 ;)
Apologize

Renaud
November 3rd, 2008 at 10:40 am

works for me! thanks renaud!

wildbill1996
November 3rd, 2008 at 11:56 pm

I’m trying to use it to connect over my carrier’s proxy, but for some reason the requests don’t go through:

16:37:50 creating a new tunnel?
16:37:50 tunnel_setopt keep_alive error: Invalid argument?
16:37:53 tunnel_in_setsockopts: non-fatal SO_RCVLOWAT error: (null)?
16:37:53 tunnel_out_setsockopts: SO_RCVLOWAT: 1?
16:37:54 tunnel_in_connect: HTTP error 502?
16:37:54 http_error_to_errno: HTTP error -502?
16:37:54 couldn’t open tunnel: Input/output error?
16:37:54 exit with status = 1

It seems that the proxy doesn’t like Keep-Alive requests and bounces them (running a sniffer shows no packets at all directed to the server). But even disabling -K option from being passed to htc (modified the Python code to do this), it still shows “keep-alive: 5″ on the debug log… Can you try to fix this, so I can use htc without keep-alive?

BTW, parameters that were used: -L 127.0.0.1:514 -D 3 -U “N73″ -F 83 -P (carriersproxy):8080 (myhost):8000

Oh, the GUI didn’t work directly, I had to extract the .sis and run the .py file directly using the Python interpreter and it works then

zenìtraM
November 7th, 2008 at 4:51 pm

First of all, your User-Agent is not a valid one. Why do you change it ? Use a valid one, like the “Nokia N70-1″ or any mobile User-agent.
Secondly, if you’re using a proxy, there’s a LOT OF CHANCE that it will let you remotely connect ONLY on port 80: don’t use port 8000 for your server !
Third, “-K” switch IS NOT keep-alive. Don’t mess with python source code. Please.
Fourth, what are the options you used for server ?
Fifth, please read and understand carefully how HTTP tunnel works. You seems to not fully understand how things works.

Renaud
November 7th, 2008 at 6:31 pm

Hi,

I changed the User-Agent just to try, the Nokia N70-1 original one does not work, either.
The proxy does let me connect on other ports than 80, I use, for example, port 11997 for connecting to IRC by using jmIRC (http://jmirc.sourceforge.net/) to login to IRC.
I thought the -K switch was for Keep-Alive, sorry, I was trying to use your HTTPTunnel without the additions you had made (i.e: chunked encoding) to try to find what makes the proxy I have to go through to bounce the connections. My provider’s proxy is not a normal HTTP proxy but a WAP proxy, it works as a HTTP proxy indeed but some headers just don’t work (301 Redirections recieved from the HTTP server, for example) and just return a 502 error. CONNECT requests don’t work, either.

After reading about HTTPTunnel, there doesn’t seem to be a way of disabling Keep-Alive request.. so i’ll keep fiddling around to see why does the server bounce the tunnel requests. Once I get to connect my N73 to my Mac as a modem, I’ll try to connect from it and use the standard HTTPTunnel and see if the requests pass through.

I tried a lot of server switches, but they don’t matter if the connection doesn’t pass through, as the sniffer tells me it doesn’t (no activity on the port I’m listening on).

zenìtraM
November 7th, 2008 at 6:57 pm

By the way, WHY do you need to use GNU HTTP Tunnel if your gateway let you connect to others ports/protocols than 80/HTTP ???

Renaud
November 8th, 2008 at 11:19 am

You can’t connect anywhere using just the gateway; you have to connect using a specific HTTP proxy (that is the cause of the problems) that only lets you connect to any port but only if you are using the HTTP protocol (GET/POST requests).

I finally got some HTTPTunnel traffic to go through the proxy, but it still doesn’t work - I’ll keep trying with different options.

zenìtraM
November 8th, 2008 at 7:30 pm

All is ok for me, great software !
A very big and fabulous developpement !

plici_stephanet
November 9th, 2008 at 7:49 pm

I have problem on my n95 8gb.
When i try to install httptunnels60.sisx and httptunnelGUI.sisx, It display an error message that informs me that certificates are not valid, and setup is aborted. I respected the steps by installing first Python for s60, pips_s60_wp.sis and openc_glib.sis. Does anybody can help me?
Thanks

Lucas
November 13th, 2008 at 5:52 pm

Go to “Application Manager->Options->Settings” and check that “Software Installation” is set to “All”.
(BTW, your contact email is not valid)

Renaud
November 14th, 2008 at 9:03 am

Hey,
This is just great you did this !
Next step is to make a wlan server to use the laptop :-)

However, I can’t run the GUI, it just stops right after beeing run like with n95 above. I reloaded your latest version and uninstalled the previous one before installing. I have a n81-3 (os9.1 like n95) with python 1.4.4 (and opencglib+pips). What did I miss ?

BTW are the GUI sources available for download (so to try and dig what happens)

Thanks for all this

deyv
November 20th, 2008 at 2:54 am

It was multiple N81 issues. Thanks to you, it now work on N81.

Renaud
November 23rd, 2008 at 7:38 pm

Hi Renaud, and thanks a lot for this awesome soft !

I have problem when I try to set up a tunnel from my Nokia N95.

I try to tunnel from 127.0.0.1:80 (phone) to my.imap.server using hts on mybox:80.

mybox runs a Debian Etch.

I have successfuly compiled and patched an http tunnel 3.0.5 from nocrew.org.
The server launch well, with the following command :
hts -a mylogin:mypass -C 80
but when I try to connect from my Nokia phone, I see this in the server log :

hts: hts (httptunnel) 4.0.0 started with arguments:
hts: me = hts
hts: device = (null)
hts: port = 80
hts: forward_port = -1
hts: forward_host = (null)
hts: proxy_buffer_size = 0
hts: proxy_buffer_timeout = -1
hts: authorization = mylogin:mypass
hts: content_length = 102400
hts: chunked = 1
hts: with-ack= 0
hts: retry-timeout= 1000
hts: debug_level = 0
hts: pid_filename = (null)
hts: max-client= 1
hts: tunnel_new_client: connected to XXX.XXX.XXX.XXX
hts: tunnel_accept: new client XXX.XXX.XXX.XXX is connecting
hts: tunnel_out_setsockopts: non-fatal SO_SNDLOWAT error: Protocol not available

What I have missed ? On the client, I’m using the following conf :

Server settings : mybox:80
Proxy Settings : Use proxy : No
Tunnel settings : Listen on port 2243
Forward to my.imap.server:143
Http settings : User-agent : the default N70 UA string
Chunked encoding : Yes
Content-lenght : 1048576
Authorization login : mylogin
Authorization password : mypass
Url prefix and Cookie are empty
Advanced settings : Keep-alive : 250
Padding bytes : 1024
Ack frames : Yes
Ack time out : 1500
Max connection age : 3600
Debug level : 10
Debug port : 514
Autostart : No

All I have on the client side is a suit of read() / write() calls, but the
connexion seems to freeze. Do you have any idea of what I’m doing wrong ?
Do you need further info ?

Thanks in advance.

Best Regards.

yodaz
December 14th, 2008 at 8:53 pm

Hi Yodaz !

You have a mismatch between hts/htc options:
On hts side, the acknowledge option is disabled (”hts: with-ack= 0″), while enabled on the other side (”Ack frames : Yes”).
This is a “shared” option. I’ll add a warning in future.
Let me know.

Renaud
December 15th, 2008 at 9:42 am

On a least one french operator, you can use a very simple solution : use the proxy 8080 and create a CONNECT tunnel instead of a GET/POST one. See connect-tunnel in CPAN. It’s much more efficient, you just have to start a ssh server on port 443 somewhere.

gni42
December 18th, 2008 at 3:26 am

Did anyone accomplish a tunnel over german Vodafone proxy 139.7.29.1:80? I tried every possible setting with no luck…

hermelin
January 19th, 2009 at 11:14 am

can someone provide a walk-through for the app since i’m a novice?

i want to use it on the german vodafone network which only allows for http port 80 connections. Is this the port it should listen to? Which port do I have to forward it to?

weezy
February 3rd, 2009 at 4:42 pm

I have the same problem as Yodaz (5 posts up) but I have symmetrical ACK settings Chunk off, matched content length (102400)

failok
February 11th, 2009 at 6:03 am

I’m dealing with Yodaz for a few days, and it seems that the problem came from your proxy which is buffering request. Deactivate chunked encoding, and use a proxy buffer size/padding equal to 0.5 to 1.0 the content-length (on both side), with minimal timeout (-T100 ?) and send me logs.

Renaud
February 11th, 2009 at 9:38 am

yeah i came to the same conclusion, no chunk, no proxy padding = 1024, no ack, content length = 102400, keep alive = 5, age = 3600, and STRICT-CONTENT-LENGTH on both sides ( your s60 gui doesnt have an option to disable).

these settings worked,still get protcol not supported but in the end a connection is established.

right now i am running hts through dd-wrt but i am having port forward/listening issues, within the same network it is working

failok
February 12th, 2009 at 9:39 am

hi, I understood what is a tunneling and I want to try it to baypas filtering of my mobile isp TIM bu I dont undertand how to setup my PC connected to ADSL how have to host GNU HTTP Tunnel 3.0.5.
Can some one tell me if there is a dummy guide to set it up?
Thank you in advance
Daifo

Daiforum
February 22nd, 2009 at 5:32 pm

[...] GNU HTTP Tunnel for S60 Something you might look at. [...]

SSH tunneling
April 28th, 2009 at 7:12 pm

Well… How to compile this on ubuntu 9.04(jaunty)x86? After ./configure, make gives me this:
hts.o: In function `main’:
hts.c:(.text+0×812): undefined reference to `encode_base64′
hts.c:(.text+0×9e7): undefined reference to `pthread_cancel’
hts.c:(.text+0xa0f): undefined reference to `pthread_join’
hts.c:(.text+0xa77): undefined reference to `pthread_cancel’
hts.c:(.text+0xa8e): undefined reference to `pthread_join’
hts.c:(.text+0xbda): undefined reference to `pthread_create’
hts.o: In function `threaded_tunnel’:
hts.c:(.text+0×13b1): undefined reference to `__pthread_register_cancel’
hts.c:(.text+0×13ce): undefined reference to `__pthread_unregister_cancel’
collect2: ld returned 1 exit status
it seems it doesen’t compile some files.

dapetcu21
July 4th, 2009 at 10:11 am

Hi, could you explain explain how to config the gui on phone and the serveur on pc to make the mail serveur forwarding?

And I have strange think in python, when I do
import e32
e32.start(‘htc60.exe’,‘-C -D2 -F 25 myadresse:80?)

I got: AttributeError:’module’ object has no attribute ’start’

If you can help me…

saq__d__aus
July 19th, 2009 at 1:56 pm

Update I change e32.start(…) to e32.start_exe(…) and no more error, but that still don’t works for mail, I have E71 and I put 127.0.0.1 in address of entering server (?) but no connexion on the serveur :’(…

saq__d__aus
July 19th, 2009 at 2:54 pm

Is there any way to tunnel a Torrent client, on my phone, thru the http tunnel? What I need is to bypass a WLAN firewall. Thanks.

Matheus
September 23rd, 2009 at 12:13 pm

I don’t know much about Torrents, but they probably use multiple connections at once. The only way could be to use your phone as modem, and from your computer, and to create a virtual TUN/TAP interface using Open VPN for example.

Renaud
September 23rd, 2009 at 12:49 pm

P/s though i lack basic knowledge of this tunnelling. But i want 2 tunnel my apps through to http simple i want pass over wall of my network providers

Zeus
September 29th, 2009 at 11:05 am

dude,ur simply genius..thanks 4 this useful apps.all this time im searching for symbian proxy manager that support user and pass so that it can be use with private proxy.thanks again

Anonymous
January 2nd, 2010 at 12:00 am

How to work this apps? This apps is for s60? My network provider blocked on socket connection and ssl , pls make at tutorial how to work on s60 to able to use my other apps.

carl
January 3rd, 2010 at 3:13 am

Bro. Do you have a version for s60 v2? Thank you.

Hideki
January 3rd, 2010 at 7:57 am

Hey!
Need a few pointers to set this up..

My college provides wifi but has a firewall(watchguard) and only 8080 is open..

So can I run hts on my home system, on port 8080, and using the http tunnel on the phone, connect to chat programs,by pass browser restrictions by enabling a new access point with the proxy as 127.0.0.1 ? or am I missing something?

thanks :)

Ash
January 30th, 2010 at 10:50 am

Leave a Comment

Name (required)

Mail (will not be published) (required)

Website

Comment