You can omit this step; the only reason for calling SOCKSinit() directly is to associate a name with your SOCKS client (rather than the generic SOCKSclient default string).
-Dconnect=Rconnect -Dgetsockname=Rgetsockname \ -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten \ -Drcmd=Rrcmd -Dselect=Rselect
If you're using a Makefile, add these options to the definition of macro CFLAGS.
These options replace calls to certain functions with versions that use the SOCKS server:
Non-SOCKS function: | SOCKS function: |
---|---|
accept() | Raccept() |
bind() | Rbind() |
connect() | Rconnect() |
getsockname() | Rgetsockname() |
listen() | Rlisten() |
rcmd() | Rrcmd() |
select() | Rselect() |
If you're using a Makefile, simply add this information to the definition of the macro LDFLAGS.
For most programs, the above steps should be sufficient to SOCKSify the package. If the above doesn't work, you may need to look at things a little more closely. The next section describes how the SOCKS library expects to be used.