Repository navigation
Add the 'proxy' parameter and deprecate 'proxies'. - #2879
Conversation
|
@encode/maintainers If we want to switch to this API, I can work on the documentation. I don't want to rush API changes, but if we believe the |
|
Yep seems like a clear API rationalisation to me, I'd be happy for us to make this switch for 1.0. It woud probably also make sense for us to widen the available types for the client = httpx.Client(
mounts={
"http://": httpx.HTTPTransport(proxy="http://127.0.0.1:80"),
"https://": httpx.HTTPTransport(proxy="https://127.0.0.1:443"),
}
) |
d71deba to
88eb99b
Compare
Co-authored-by: T-256 <132141463+T-256@users.noreply.github.com>
Co-authored-by: T-256 <132141463+T-256@users.noreply.github.com>
|
Okay, so I can say that we should carefully consider how we will document this. That new PR should answer this question:
I also want that PR will make HTTPX documentation more user-friendly and add some Mkdocs material features that can possibly make the documentation more readable and pleasant. |
|
Excellent questions, though quite wide ranging. For the purposes of this pull request I'd suggest that...
|
lovelydinosaur
left a comment
There was a problem hiding this comment.
Looking good.
The command-line client also currently uses --proxies - I'd suggest we change that also.
For example here...
Line 72 in e63b659
as well as in a few other places in that module.
|
Do we want to keep the proxies argument in the cli app? |
I'm happy with making that change, yes. |
Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
|
Looking great. Let's...
|
Yes
Is there a reason we need to get rid of docstring? I thought we were going to remove everything related to |
I implemented transition as suggest in encode/httpx#2879
* Add the proxy parameter and deprecate proxies * Make the Client.proxy and HTTPTransport.proxy types the same * Update httpx/_transports/default.py Co-authored-by: T-256 <132141463+T-256@users.noreply.github.com> * Update httpx/_transports/default.py Co-authored-by: T-256 <132141463+T-256@users.noreply.github.com> * Drop unneeded noqa * Changelog * update documentation * Allow None in mounts * typos * Update httpx/_types.py * Changes proxies to proxy in CLI app * Add proxy to request function * Update CHANGELOG.md Co-authored-by: Tom Christie <tom@tomchristie.com> * Update docs/troubleshooting.md Co-authored-by: Tom Christie <tom@tomchristie.com> * Update docs/troubleshooting.md Co-authored-by: Tom Christie <tom@tomchristie.com> * Lint --------- Co-authored-by: Tom Christie <tom@tomchristie.com> Co-authored-by: T-256 <132141463+T-256@users.noreply.github.com>
see encode/httpx#2879 for more info
The home page now presents CodeIntent Dependency Check: a hero with a replica of the real demo Dependabot PR (diff, failing check, the highlighted proxies= line), a GitHub-style replica of the actual comment for openai-python and httpx 0.28, an interactive isometric inspection bench showing the five stages (manifest, usage scan, both releases compared, upstream PR, verdict stamp) with keyboard control and a reduced-motion path, the four verdicts and why none is a tick, the upstream trail from encode/httpx#2879 to #3319, the early warning one release before each break, advisories, where findings show up (PR check, Telegram, MCP, dashboard), the backtest facts read from public/backtest.json, and security and honesty. Every fact comes from verified runs or the live demo PRs. IBM Plex typography and the dark ledger language are kept; styles live in app/landing.css scoped under .lp, components under components/landing (with a trimmed MIT copy of the anatomy isometric kit, credited). The page is static. The investigation workspace stays reachable from the footer. tsconfig excludes the gitignored artifacts/ snapshot, which imported the old landing component. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Summary
HTTPX supports
proxiesandmountsarguments, which are not the same, butmountscan simply replaceproxiesfor complex routing, which is not always used.So for simplicity, this PR deprecates
proxiesand addsproxyargument.You can still use
proxies, but it will warn you that it is deprecated and that you should use the new API.Use...
proxyif you want to use a proxy server for all your requests.mountsif you want to use a proxy server for requests matching the URL pattern you specified.Proxy
Mounts