Just a basic monkey patch to give socks5 support to python sockets. Usage: Set the socks_proxy os environment variable. Import it before anything else that will be using sockets. If the environment variable isn't set, then no proxying will occur socks_proxy="<DESTPORT1,DESTPORT2,...,DESTPORTN:>[username[:password]@]<PROXYHOST:><PROXYPORT>" Caveats: only supports ipv4 only supports socks5 user/pass auth has not been tested if socks_proxy env variable is set, all socket connections on that port will use it