Normally, when using httplib (python 2.x) or http.client (python 3.x), you set up a connection and make a request like so:
from http.client import HTTPConnection
from urllib.parse import urlparse, urlencode
url = urlparse("http://final.destination.example.com:8888/")
conn = HTTPConnection(url.netloc)
request_path = "%s?%s" % (url.path, url.query)
conn.request("POST", request_path, post_data)
(note that this example code has python 3.x imports)
I am in a situation where I would like to use http.client for performance reasons, but I'd also like to use a SOCKS proxy for remote access into a cluster.
Is there any way to use a SOCKS proxy with httplib/http.client?