Use socks proxy requests

requests in 2.10.0 version began to support socks proxy

He made himself the way a server so I want to use it.

import requests

url = 'xxx'
my_proxies={"http": "socks5h://127.0.0.1:10808","https": "socks5h://127.0.0.1:10808"}
r = requests.get(url=url, proxies=my_proxies, timeout=5)

  

Used here is socks5h, I started using socks5 but has been given OsError, and may I use local agents about, replaced socks5h enough.

 

Guess you like

Origin www.cnblogs.com/wrnmb/p/12455650.html