Friday, June 6, 2008

TCP/Anywhere - TCP transport through HTTP proxies

I recently had a question about how to get an application without support for a network proxy through a firewall. This is a challenge I met and beat back a few years ago (winning a bet in the process haha). See below for detail on how to use my TCP/Anywhere application to get services that don't support proxies out to the internet.

TCP/Anywhere makes non-proxy friendly applications work like they do back home. (Note: some proxy servers disable CONNECT rendering this method inoperative)

Windows users will want to download Cygwin and Cygwin Perl (link), though TCP/Anywhere may work with recent versions of ActivePerl(untested). Grab a copy of TCP/Anywhere (link) Next, extract TCP/Anywhere someplace in your cygwin path.

Ex.
"c:/documents and settings/$USERNAME%"


You'll then want to know what TCP ports that your application talks on. Here are a few "common" ports:

POP3: 110
SMTP: 25
SSH: 22
Telnet: 23
FTP: 21
NNTP: 119
VNC: 5900
RemoteDesktop: 3389

Next, open one of the TCP/Anywhere INI files (or create a new one) with your favorite editor. Be sure to give it everything that you need to connect to. (Note: only one INI per TCP/Anywhere instance)

Set this option to one of the remote ports in the above table (Note: you may also set this to your own TCP port, on some systems the local port must be over 1024)

port=REMOTE_PORT

Set this tag to the host you would like to connect to, followed by theport (use a : to separate)

remote=REMOTE_HOST:REMOTE_PORT

Set the proxy address to your internal proxy server (check your browser settings for this information).

proxyaddress=proxy.server.yourco.com

Configure the proxy port to the internal proxy servers service port (check your browser settings for this information).

proxyport=PROXY_PORT

Configure the connection pool to the maximum number of concurrent connections you would like to service. This will not cause the application to exit at MAX_NUM_CONNECTIONS, it will just throttle the application to only use up to MAX_NUM_CONNECTIONS connections at a time. The default of 20 is usually sufficient.

connections=MAX_NUM_CONNECTIONS

Lastly, the local tag tells the application to listen locally or globally. If set to global, other persons on your network will be able to access this application from their computers. Typically set to 0.

local=NUMBER

Once configured, save your changes and exit your editor. From the command line, execute the application.

./tcpawmyconfig.ini

When TCP/Anywhere returns the prompt, open your favorite application. Configure the application to connect to your local network IP address on whatever port you set as "port=" in the ini file. Ask your application to connect, and if all goes as planned you'll have access! It's that easy.

Get TCP/Anywhere (5KB) - [HERE]
Get TCP/Anywhere Server (5KB) - [HERE]

0 comments: