in reply to Two Way TCP Tunnel with POE

mfwd is an utility I wrote a long time ago that does exactly that. It is written in C and the code is available from the SourceForge CVS. I have not been maintaining it, but it is pretty simple, so any compile or runtime error should be easy to fix. At least, it still compiles cleanly on my Linux box.

There were also a popular Perl script that implemented a TCP proxy, but I can remember its name :-(

But anyway, my advise would be also to use something more standard like SSH tunnels if you can!