docs: Enhance proxy usage documentation with the correct usage#570
docs: Enhance proxy usage documentation with the correct usage#5700x676e67 merged 3 commits into0x676e67:mainfrom
Conversation
Expanded the proxy usage documentation to include authentication, per-request proxies with custom headers, and clarified Unix socket proxy usage.
Updated the proxy usage example to reflect the new Client initialization with a list of proxies.
Fix formatting of bullet points in quickstart.md
📝 WalkthroughWalkthroughThe pull request updates documentation for proxy usage in the wreq library, replacing references to the single-proxy pattern ( Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the proxy documentation to reflect API changes, specifically transitioning the Client constructor to use a proxies list and providing more detailed examples for authentication, custom headers, and Unix sockets. However, the documentation incorrectly uses the plural proxies parameter for per-request methods like wreq.get, which actually expect a single proxy object.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/source/guide/proxy.md`:
- Around line 19-21: Update the documentation to use the correct parameter name
"proxies" (plural) for per-request usage so it matches the examples; change the
sentence that currently shows wreq.get(..., proxy=...) to wreq.get(...,
proxies=[...]) and ensure references to Client(proxies=[...]), wreq.get(...,
proxies=[Proxy.all(...)]), and wreq.get(..., proxies=[Proxy.unix(...)]) are
consistent throughout the file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d4bc971b-11ac-4ec7-acb2-b629c7738a8f
📒 Files selected for processing (2)
docs/source/getting-started/quickstart.mddocs/source/guide/proxy.md
| You can pass a proxy in two ways: | ||
| - **Per-client** via `Client(proxies=[...])` — applies to every request made by that client. | ||
| - **Per-request** via `wreq.get(..., proxy=...)` — overrides or sets a proxy for a single request. |
There was a problem hiding this comment.
Fix parameter name inconsistency.
Line 21 states that per-request proxies use proxy=... (singular), but all the per-request examples in this file use proxies=[...] (plural):
- Line 103:
await wreq.get(..., proxies=[Proxy.all(...)]) - Line 136:
await wreq.get(..., proxies=[Proxy.unix(...)])
The examples suggest the correct parameter name is proxies (plural) for both client-level and per-request usage.
📝 Proposed fix
You can pass a proxy in two ways:
- **Per-client** via `Client(proxies=[...])` — applies to every request made by that client.
-- **Per-request** via `wreq.get(..., proxy=...)` — overrides or sets a proxy for a single request.
+- **Per-request** via `wreq.get(..., proxies=[...])` — overrides or sets a proxy for a single request.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| You can pass a proxy in two ways: | |
| - **Per-client** via `Client(proxies=[...])` — applies to every request made by that client. | |
| - **Per-request** via `wreq.get(..., proxy=...)` — overrides or sets a proxy for a single request. | |
| You can pass a proxy in two ways: | |
| - **Per-client** via `Client(proxies=[...])` — applies to every request made by that client. | |
| - **Per-request** via `wreq.get(..., proxies=[...])` — overrides or sets a proxy for a single request. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/source/guide/proxy.md` around lines 19 - 21, Update the documentation to
use the correct parameter name "proxies" (plural) for per-request usage so it
matches the examples; change the sentence that currently shows wreq.get(...,
proxy=...) to wreq.get(..., proxies=[...]) and ensure references to
Client(proxies=[...]), wreq.get(..., proxies=[Proxy.all(...)]), and
wreq.get(..., proxies=[Proxy.unix(...)]) are consistent throughout the file.
Summary by CodeRabbit