Repository navigation
Replies: 1 comment
|
Both import httpx
import ssl
ctx = ssl.create_default_context(cafile="ca-bundle.pem")
ctx.load_cert_chain("client-cert.pem", "client-key.pem")
proxy = httpx.Proxy(
"http://proxy.example:80",
headers={"X-Goog-Iap-Jwt-Assertion": proxy_token},
)
with httpx.Client(proxy=proxy, verify=ctx) as client:
# make requests here
...Use your actual CA bundle and client certificate/key paths above. If you need separate routing via mounts, use |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I'm working on a project and we use Httpx to make call to an API threw a proxy and we would like to up our version to 0.28.1.
Until version 0.27.2, in Client object, parameter proxies was deprecated but still available. So we use it to make our configuration as it :
I seen in this post #2879 that, in the new version, the way to make this was to use parameter mount with HTTPTransport object.
But when i am looking into Httpx documentations (for Client or HTTPTransport) or anywhere else, i don't find how to pass my proxy headers with HTTPTransport.
Can anyone enlighten me ?
Thanks in advance.
All reactions