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 errorWhile 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
httpscheme for bare hostname in proxy.getlist()