HTTP Proxy Port Bridge

August 7th, 2007

There are many networks where connection is limited to HTTP, FTP over Proxies (Academical networks; publicly available wi-fi's etc.) or where http proxy has much faster connection than other protocols.

I also wanted to review Linux networking and write some general-usage tool. And so I did...

Bridge consist of two elements: Sender and receiver. Both must be set up before connection takes place. After start sender (hppbs) opens data port and waits for connection from bridged client, and hppbr (receiver) opens bridge port and waits for sender to connect.

When something (like SSH) connects to sender data port, sender connects to the receiver and sends HTTP request:

POST /Conn[ConnectionID]_[Sequence number] HTTP/1.1
Host: [Bridge address]
Content-Type: multipart/form-data 
Content-Length: 1

[binary code for INIT]

Receiver then opens connection to specified host and port; if it's successful it resends header:
HTTP/1.0 200 OK
Cache-Control: nocache

[binary code for ACK]


Or FAIL instead of ACK if connection is impossible. Then the bridge connection is broken.

Now, until one of the data ports is closed, sender initiates connection to receiver once per some time period. HTTP requests contains data to be sent to the receiver data port, and in reply receiver includes data from it's port.

Code may be found under the following address: HPPB(git) but it lacks many features (like breaking, and resetting bridge on connection end) and is in early development stage. I doubt if it will ever change. ;) Instead of adding new features I'd rather clean the code. It's horrible.

Using this tool I've done SSH connection, and remote desktop (with some Windows box) connection (which was surprisingly much faster than in the usual way) over transparent proxy in my network.

If you like it, please let me know.

Add a comment [+] Hide the comment form [-]

I'm a bot, please ignore this comment.

I'm not a bot. Tick this box.

This is a mail of my good friend who loves rubbish email. Send him some if you want to land on my not-so-welcome lists: John Sparrow john@thera.be john(at)thera.be