diff --git a/docs/source/guide/proxy.md b/docs/source/guide/proxy.md index 6c64b16a..17a76b96 100644 --- a/docs/source/guide/proxy.md +++ b/docs/source/guide/proxy.md @@ -74,13 +74,13 @@ client = Client(proxies=[proxy]) ```python # SOCKS5 client = Client( - proxies=[Proxy.http("socks5://username:password@127.0.0.1:1080")] + proxies=[Proxy.all("socks5://username:password@127.0.0.1:1080")] ) # SOCKS5h (DNS also resolved by the proxy) client = Client( - proxies=[Proxy.http("socks5h://username:password@127.0.0.1:6152")] + proxies=[Proxy.all("socks5h://username:password@127.0.0.1:6152")] ) ``` @@ -100,8 +100,7 @@ from wreq import Proxy async def main(): resp = await wreq.get( "https://httpbin.io/anything", - proxies=[ - Proxy.all( + proxy=Proxy.all( url="http://127.0.0.1:6152", custom_http_headers={ "user-agent": "wreq", @@ -110,7 +109,6 @@ async def main(): "x-proxy": "wreq", }, ) - ], ) print(await resp.text()) @@ -133,7 +131,7 @@ from wreq import Proxy async def main(): resp = await wreq.get( "http://localhost/v1.41/containers/json", - proxies=[Proxy.unix("/var/run/docker.sock")], + proxy=Proxy.unix("/var/run/docker.sock"), ) print(await resp.text()) @@ -141,16 +139,3 @@ asyncio.run(main()) ``` Even though the URL says `http://localhost`, the request never touches the network. It goes directly through the socket file at the given path. - ---- - -## Choosing the right constructor - -Each constructor controls which requests are intercepted by the proxy: - -| Constructor | Intercepts | -|---|---| -| `Proxy.all(url)` | All requests (HTTP + HTTPS) | -| `Proxy.http(url)` | HTTP requests only | -| `Proxy.https(url)` | HTTPS requests only | -| `Proxy.unix(path)` | Requests via a Unix socket | diff --git a/docs/source/guide/websocket.md b/docs/source/guide/websocket.md index 2b21d910..db617203 100644 --- a/docs/source/guide/websocket.md +++ b/docs/source/guide/websocket.md @@ -96,7 +96,7 @@ async def recv_message(ws): async def main(): # Connect to HTTP/2 WebSocket server - client = wreq.Client(verify=False) + client = wreq.Client(tls_verify=False) ws: WebSocket = await client.websocket( "wss://127.0.0.1:3000/ws", version=Version.HTTP_2 diff --git a/tests/multipart_test.py b/tests/multipart_test.py index b251787a..f61a51e0 100644 --- a/tests/multipart_test.py +++ b/tests/multipart_test.py @@ -21,7 +21,9 @@ async def test_reuse_multipart_with_clonable_parts(): form = Multipart( Part(name="a", value="1"), Part(name="b", value=b"2"), - Part(name="c", value=Path("./README.md"), filename="README.md", mime="text/plain"), + Part( + name="c", value=Path("./README.md"), filename="README.md", mime="text/plain" + ), ) for _ in range(3):