public
Created

httplib in python 2.7 set proxy

  • Download Gist
httplib_set_tunnel.py
Python
1 2 3 4 5 6 7 8
import httplib
c = httplib.HTTPSConnection('localhost',8118)
c.set_tunnel('twitter.com',443)
c.request('GET','/')
r1 = c.getresponse()
print r1.status,r1.reason
data1 = r1.read()
print len(data1)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.