python-proxy
python-proxy copied to clipboard
Avoid unauthorised traffic? Authentication or whilelisting
Hi,
Great program! I noticed there is a way to blacklisting with rules, but I need more a whitelist or alternatively a way to allow only requests from a specific source (a password maybe?)
I notice that can be done something like : http://0.0.0.0:8080#username:password to have http auth but it does return Unauthorized HTTP using:
from requests.auth import HTTPBasicAuth
proxy_url = "http://localhost:8080"
proxies = {"http": proxy_url, "https": proxy_url}
requests.get("https://api.myip.com", proxies=proxies, auth=HTTPBasicAuth('username', 'password')).json()
Thank you