code/pconnect()

Proxy Connect

Proxy Connect is a LD preload library that can be used to tunnel arbitrary TCP connections via HTTP proxy cascades which support the `CONNECT' command.

Currently, two tunnel setups are supported:
     Point to Point to Multipoint
+--------+    +-------+    +----------+
| CLIENT +----+ PROXY +----+ INTERNET |
+--------+    +-------+    +----------+
This configuration makes sense if you are connected to a LAN which provides a HTTP proxy that takes `CONNECT' commands to arbitrary ports.

     Point to Point to Point to Multipoint
+--------+ +---------+ +---------+ +----------+
| CLIENT +-+ PROXY A +-+ PROXY B +-+ INTERNET |
+--------+ +---------+ +---------+ +----------+

This setup can be used to tunnel through a connected proxy A which supports `CONNECT' to certain ports only (eg https, 443). Over this connection another `CONNECT' can be sent to proxy B without this limitation that isn't reachable otherwise. Download proxy_connect-0.6 here.
 
design based on fct