Python proxy function

Cobare

Regular Member
Joined
Mar 14, 2019
Messages
247
Reaction score
67
Hi guys,
How can i add proxy function on my python script?
I want to use socks5 proxy.
Thanks.
 
Should be something like this if you only got problems with the sock5 factor. You will need to install proxies before e.g. PySocks (pip install pysocks)
Code:
proxies={http:'socks5://user:pass@host:port',
          https:'socks5://user:pass@host:port'}
Then use those e.g. in that manner
Code:
response = requests.get(host_url, headers=headers, proxies=proxies)
Be aware Im not an expert myself :p
 
Back
Top