htun: transparent tunnel for transporting IP traffic over HTTP or TCP


htun is a transparent tunnel for transporting IP traffic over HTTP or TCP.

It was developed with situations in mind where traffic to the internet is restricted. For instance, some networks don’t allow traffic to the internet at all and require you to go through an HTTP proxy. htun enables you to get full internet access in those situations (all ports, all protocols). It also supports using a SOCKS proxy.

Obviously, performance takes a huge it. So it is meant for some light browsing or downloading small files sporadically. Expect transfer rates to be cut by a factor of up to 100.

Also, it is not encrypted by default. It is recommended to put another tunnel on top, such as Wireguard.

Since python-pytun is required, which is a non-portable module, this will only run on Linux.


git clone

pip3 install -r requirements.txt


By default, it uses HTTP on port 80 and the IP addresses and for the client and the server, respectively.

transparent tunnel


TCP Tunnel

To use a TCP tunnel on port 443, run

./ --server tcp -p 443

on the server side and

./ --uri tcp://<host>:443

on the client side. Now the client can reach the server via the IP address


To use HTTP over a SOCKS5 proxy on port 5000, run

./ --server

on the server side and

./ --uri http://<host> --proxy socks5://<proxy-host>:5000

on the client side.


Copyright (c) 2018 Adrian Vollmer