python Requests work via socks 4/5 https/http proxy

- Posted in Python by
pip install -U requests[socks]

using

# SOCKS5 proxy for HTTP/HTTPS
proxies = {
    'http' : "socks5://myproxy:9191",
    'https' : "socks5://myproxy:9191"
}

#headers
headers = {

}

url='http://icanhazip.com/'
res = requests.get(url, headers=headers, proxies=proxies)

type:



# SOCKS5 proxy for HTTP/HTTPS proxiesDict = { 'http' : "socks5://1.2.3.4:1080", 'https' : "socks5://1.2.3.4:1080" } # SOCKS4 proxy for HTTP/HTTPS proxiesDict = { 'http' : "socks4://1.2.3.4:1080", 'https' : "socks4://1.2.3.4:1080" } # HTTP proxy for HTTP/HTTPS proxiesDict = { 'http' : "1.2.3.4:1080", 'https' : "1.2.3.4:1080" }

_https://stackoverflow.com/questions/12601316/how-to-make-python-requests-work-via-socks-proxy