Re: Socksifying Squid

From: Oleg Makarenko <>
Date: Wed, 06 Jan 1999 01:30:59 +0300


First of all you need working socks configuration.

Compile/install socks package and make sure that rtelnet works from
machine with squid. You should create /etc/libsocks5.conf or use
environment variables to point your socks clients to socks server
(export SOCKS_SERVER=your.socks.server.ip, see man libsocks5.conf and
man socks5.conf for details)

When you'll be able to rtelnet some Internet host (rtelnet 80) from your squid machine you should decide what DNS
configuration you want to use. To run squid with runsocks and without
any other modifications your squid machine (not only your socks server)
should be able to resolve names itself (use caching-only/forward-only
bind on your socks server, for example).

The only problems I had with that configuration were:

1. Sometimes some of dnsservers do not want to start
2. Users get strange error messages from squid when something is wrong
with connection to host (they may get "write error" or "no error"
instead of "connection refused" etc)

All these (not serious) problems come from the socksification and you
need to patch libsocks or squid to solve them.

I have patched squid (conn.c, if I remember it correctly, SOCKSconnect()
may change errno even on success and getsockoptions() is not socksfied
so you need some other way to get error from previous connect() (I used
second connect() instead of getsockoptions()). If you think you need the
patch I can mail it to you with my sock5.conf and libsocks5.conf (I
don't have them handy).

Best regards,

Andy Walden wrote:
> I have been through the archives and tried a couple of different things to
> socksify squid. The first thing tried is runsocks squid -sY, which results
> in Squid never actually running and just returning me to a prompt after 15
> seconds or so. The second thing I have tried is the compile line given by
> Henrik in the archives env CFLAGS="-g -O2 -Wall -Dbind=SOCKSbind"
> LIBS="-lsocks" ./configure and get the result, checking whether the C
> compiler (gcc -g -O2 -Wall -Dbind=SOCKSbind -g)
> then configure: error: installation or configuration problem: C compiler
> cannot create executables. Which Henrik replied that socks was installed
> incorrectly. I just did a make install and it worked, so I'm not sure what
> the correct way is. Do I need a /etc/libsocks5.conf or any other config
> file possibly to make this work? Surely there are others that
> successfully have this running. Any help is appreciated. Thanks in
> advanced.
> Sincerely,
> Andy Walden
> System Administrator
> MTCO Communications
> 1-800-859-6826
Received on Tue Jan 05 1999 - 15:19:28 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:43:54 MST