python-proxy icon indicating copy to clipboard operation
python-proxy copied to clipboard

Avoid unauthorised traffic? Authentication or whilelisting

Open ValerioNeriGit opened this issue 3 years ago • 0 comments

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

ValerioNeriGit avatar Feb 04 '22 04:02 ValerioNeriGit