def curl_tyt(port):
buf=cStringIO.StringIO()
cc=pycurl.Curl()
cc.setopt(cc.URL,'http://10.67.21.11')
cc.setopt(cc.WRITEFUNCTION,buf.write)
cc.setopt(cc.CONNECTTIMEOUT,5)
cc.setopt(cc.TIMEOUT,8)
cc.setopt(cc.PROXY,'http://10.67.21.11:%s'%port)
cc.perform()
转载于:https://blog.51cto.com/4249964/1566862