Python SocksiPy Global Setting edit


This module was designed to allow developers of Python software that uses the Internet or another TCP/IP-based network to add support for connection through a SOCKS proxy server with as much ease as possible.

Global Setting for urllib2 Example

You can use SocksiPy module. Simply copy the file "" to your Python's lib/site-packages directory, and you're ready to go. you must use socks before urllib2. For example:
import socks
import socket
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "", 8080)
socket.socket = socks.socksocket
import urllib2
print urllib2.urlopen('').read()
You can also try pycurl lib and tsocks, for more detail, click on here.


Post a Comment

Newer -> <- Older