File: How_to_SOCKSify

package info (click to toggle)
socks4-server 4.3.beta2-20
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 1,512 kB
  • ctags: 1,778
  • sloc: ansic: 19,305; makefile: 399; sh: 52
file content (44 lines) | stat: -rw-r--r-- 2,068 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Four Easy Steps to SOCKSify (Most of) Your Favorite Network Programs
		For use with SOCKS 4.3
		(Ying-Da Lee, ylee@esd.sgi.com  or yingda@best.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]);

   This step can be omitted. The only consequence is that the generic
   'SOCKSclient' rather than the actual client program name will be
   used in the syslog lines on the client host.

3) Add 

   -Dconnect=Rconnect -Dselect=Rselect -Dgethostbyname=Rgethostbyname -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten

(or, on AIX,
   -Dconnect=Rconnect -Dselect=Rselect -Dgethostbyname=Rgethostbyname -Dngetsockname=Rgetsockname -Dbind=Rbind -Dnaccept=Raccept -Dlisten=Rlisten
)
   to all cc lines. If Makefile is used, this is simply done by adding
   the above to the definition of macro CFLAGS.

   If the application does not use the bind/listen/accept/getsockname
   sequence to establish passive connections (most don't) or if your
   SOCKS server does not support RBIND ('sockd -ver' will tell you
   whether it does or not), you can drop the corresponding definitions
   for those functions; i.e., end with -Dgethostbyname=Rgethostbyname.

4) Make sure that the appropriate SOCKS library (version 4.2, built with
   -DSHORTENED_RBIND) is linked in in the ld or the last cc command to
   produce the executable.

That's it for most programs. Build the program and try it, chances
are it would work. If it doesn't and you still like to have a SOCKSified
version, please read the file What_SOCKS_expects.