proxy3.c

Forwards any remote TCP port to the local machine. Optionally logs the TCP traffic to a file or to stdout. Optional authenticated mode requires a simple cleartext password handshake to be negotiated before any TCP connection is forwarded.

Source code: proxy3.c.
Compile like this: gcc -O3 -o proxy3 proxy3.c
On Solaris you might need -lnsl, or maybe not any more. I don't really know. I haven't tried compiling anything on Solaris in the current century...

Typical use:

        proxy3 www.example.com 80 1080 -o nntp.log
	lynx http://localhost:1080/

Footnote: this was my first program ever that used the Unix socket interface. I wrote it in order to learn this stuff, but also because I needed the functionality, which I didn't know where to find back then, in 1997. Nowadays I use SSH to forward ports of course, but on occasion I crank up this old program and use it for debugging etc.