Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticated Proxy Fails #68

Open
tomworster opened this issue Nov 3, 2023 · 1 comment
Open

Authenticated Proxy Fails #68

tomworster opened this issue Nov 3, 2023 · 1 comment

Comments

@tomworster
Copy link

Standard requests are not using the proxy username/password.

Was able to fix this as a workaround by modifying utils.py get_proxy as follows:

First, import quote from urllib.parse:

from urllib.parse import quote

Second, update get_proxy when proxy_type is "requests" to add the username/password and format the proxy url as http://:@:.

        if proxy_type.lower()=="requests":
            user_pass = ""
            if proxy["proxy_username"] and proxy["proxy_password"]:
                username = quote(proxy["proxy_username"], safe="")
                password = quote(proxy["proxy_password"], safe="")
                user_pass = f"{username}:{password}@"

            proxy_url = "%s%s%s:%s" % ("http://", user_pass, proxy["proxy_url"], proxy["proxy_port"])
            proxies = {
                    "http" : proxy_url,
                    "https" : proxy_url
                }

Not clear why the UI has the username/password but it is not in use by the code.

@RandomUser1215R
Copy link

I had the same problem and your code fixed it !

Thanks a lot @tomworster

I hope it'll be fixed in the next version cc @JasonConger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants