Six Easy Steps to SOCKSify (Most of) Your Favorite Network Programs
		(Ying-Da Lee, ylee@syl.dl.nec.com>)
===================================================================

1) Find out if UDP is used in the program by doing "grep SOCK_DGRAM" on
   all the source files. If any such lines are found (and are not comments),
   you can't make it work with SOCKS. There is, however, a UDP relayer
   which is to UDP what SOCKS is to TCP, and you may want to look into
   it. It is written by Tom Fitzgerald <fitz@wang.com> and is available
   from host ftp.wang.com, file /pub/fitz/udprelay-0.2.tar.Z.

2) At or near the beginning of the main procedure, add this line:
   SOCKSinit(argv[0]);

3) Find all occurrences of accept, bind, connect, getsockname, and
   listen function calls. (I have this line in my .cshrc:

   alias socksok egrep -n \'connect\\\(\|connect \\\(\|accept\\\(\|accept \\\(\|bind\\\(\|bind \\\(\|getsockname\\\(\|getsockname \\\(\|listen\\\(\|listen \\\(\'

   So I can find all these function calls by applying "socksok" to all
   the source files.)

4) Prepend 'R' to each occurrence of accept, bind, connect, getsockname, and
   listen function calls.

5) For a bind call, find out the IP address of the host it is aimed for
   and add that as an additional last argument for Rbind. This is usually
   the destination host used in the previous connect call.

6) Modify the Makefile so that the SOCKS library is searched during
   "ld" or the final "cc".

That's it for most programs if you are using versatile SOCKS clients
for your finger, telnet, and maybe ftp.

If the program uses unusual features, such as the non-blocking calls
of connect() in Mosaic 2.0, then you have to read and understand the
code a little better and try to do some adjustment. This doesn't seem
to happen very often.

So go ahead and SOCKSify!
