How to add auth proxy support in python?
-
would be appreciated if someone can help me threw discord rq
FaXeN#3605
thanks!
-
if you're using requests lib:
import requests s = requests.Session() s.proxies = { “http”: “http://10.10.10.10:8000”, “https”: “http://10.10.10.10:8000”, } r = s.get(“http://target.com”)
for auth proxies http://user:[email protected]:8000
you can change the http/https with right protocol
and for multiple proxies you put them on an array and manage them on your way and use one of them in each request.proxies = [{ “http”: “http://10.10.10.10:8000”, “https”: “http://10.10.10.10:8000”, }, { “http”: “http://10.10.10.11:8000”, “https”: “http://10.10.10.11:8000”, }]
-
how can i use that?
-
import requests proxies = {"http":"http://username:[email protected]_ip:proxy_port"} r = requests.get("http://www.example.com/", proxies=proxies) print(r.content)