about CONNECT method
how to use
import httplib
con = httplib.HTTPConnection(proxyHost, proxyPort)
con.set_tunnel("www.google.com", 80)
con.send("Sent Stuff")
send方法
- 使用proxyHost, proxyPort建立socket連接(不是SSL)
- 建立tunnel: CONNECT proxyHost:proxyPort HTTP/1.0\r\n
- 必要時(shí),加上認(rèn)證
'Proxy-Authorization: Basic xxxx\r\n'
- con如果是httplib.HTTPConnection的實(shí)例奠涌,則通過(guò)socket通信职辨;
con如果是httplib.HTTPSConnection的實(shí)例茫舶,則通過(guò)SSL通信铭污。