HTTP-encapsulated tunnels are useful when you want to use games, IM clients, or P2P sharing applications across restrictive firewalls or proxies which tend to block pretty much everything except well known traffic such as HTTP traffic.
httptunnel is GNU/GPL-licensed free software that allows you to create a bi-directional tunnel encapsulated by HTTP, between client and server. httptunnel works by encapsulating all bi-directional data traffic between client and server inside HTTP requests.
In this tutorial, let me demonstrate how to create an HTTP tunnel using httptunnel.
Install Httptunnel on Linux
httptunnel consists of hts (server) and htc (client) components to establish HTTP tunnels in between.
In order to install httptunnel on Linux (on both server and client side), follow the steps below.
To install httptunnel on Ubuntu, Mint, or Debian:
To install httptunnel on CentOS or RHEL, first set up Repoforge on your system, and then run:
To install httptunnel on Fedora, simply run:
Set up an HTTP Tunnel in Linux
In order to set up an HTTP-encapsulated tunnel using httptunnel, refer to the example below.
On server side:
The above command tells hts to listen on port 80, and to redirect all traffic received on port 80 to <port_of_your_app>
On client side:
The above command tells htc to receive traffic on localhost:<port_of_your_app>, which then is redirected to <server_ip_addr>:80, optionally via proxy (in case the client is behind HTTP proxy).
At this point, the application instances running on two end hosts can communicate with each other transparently via an HTTP tunnel.
If you are conscious about the security of plain-text HTTP tunnels, or reduce the risk of firewall blocking, you can consider setting up SSH tunneling, which can protect you against eavesdropping, thereby is more robust against potential firewall fingerprinting.
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!