-
-
Notifications
You must be signed in to change notification settings - Fork 839
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
Support bare hostname in proxy #1118
Conversation
Fantastic, loving this, thanks! 😃 One interesting question here... Eg. If for scheme in ("http", "https", "all"):
if proxy_info.get(scheme):
mounts[scheme] = proxy_info[scheme] to instead be this... for scheme in ("http", "https", "all"):
if proxy_info.get(scheme):
hostname = proxy_info[scheme]
mounts[scheme] = hostname if "://" in hostname else f"http://{hostname}" Then we wouldn't change the code in client = httpx.Client(proxies="http://localhost:1234") # Okay
client = httpx.Client(proxies="localhost:1234") # Invalid, raises an error While still handling the fuzzy Thoughts? |
Great stuff! Agreed with ^. :-) Also, if we go the "env vars only" path, we can probably update the Environment Variables: HTTP_PROXY, HTTPS_PROXY, ALL_PROXY docs as part of this PR? (Could be a follow-up task too, don't mind.) |
Great catch on the We can treat them separately (Because I'd probably prefer that we |
@florimondmanca Yes, good call. General note: We're also missing |
Yup. I'm working on a revamp of proxy docs anyway so I can include that stuff there as well. |
Closes #1082
http
scheme for bare hostname in proxy.getlist()