c1.setopt(pycurl.PROXYTYPE, pycurl.PROXYTYPE_SOCKS5)
c2 = pycurl.Curl()
c2.setopt(pycurl.URL, 'http://www.yahoo.com')
c2.setopt(pycurl.PROXY, 'localhost')
c2.setopt(pycurl.PROXYPORT, 8081)
c2.setopt(pycurl.PROXYTYPE, pycurl.PROXYTYPE_SOCKS5)
c1.perform()
c2.perform()
Using urllib2 with SOCKS proxy