You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,15 @@
1
1
The `python-proxy-headers` package provides support for handling custom proxy headers when making HTTP requests in various python modules.
2
2
3
-
We currently add support to the following packages:
4
-
* urllib3
5
-
* requests
6
-
* httpx
7
-
* aiohttp
3
+
We currently provide extensions to the following packages:
8
4
9
-
None of these modules provide good support for parsing custom response headers from proxy servers. And some of them make it hard to send custom headers to proxy servers. So we at [ProxyMesh](https://proxymesh.com) made these extension modules to support our customers that use Python and want to use custom headers to control our proxy behavior. But these modules can work for any custom headers through any proxy.
Examples for how to use our support modules are described below.
10
+
None of these modules provide good support for parsing custom response headers from proxy servers. And some of them make it hard to send custom headers to proxy servers. So we at [ProxyMesh](https://proxymesh.com) made these extension modules to support our customers that use Python and want to use custom headers to control our proxy behavior. But these modules can work for handling custom headers with any proxy.
11
+
12
+
Examples for how to use these extension modules are described below.
12
13
13
14
## urllib3
14
15
@@ -102,7 +103,7 @@ r = httpx_proxy.get('https://api.ipify.org?format=json', proxy=proxy)
102
103
r.headers['X-ProxyMesh-IP']
103
104
```
104
105
105
-
And finally, httpx supports async requests, so provide an async extension too:
106
+
And finally, httpx supports async requests, so we provide an async extension too:
106
107
107
108
```python
108
109
import httpx
@@ -114,3 +115,6 @@ async with httpx.AsyncClient(mounts={'http://': transport, 'https://': transport
114
115
115
116
r.headers['X-ProxyMesh-IP']
116
117
```
118
+
119
+
Our httpx helper module internally provides extension classes for [httpcore](https://www.encode.io/httpcore/), for handling proxy headers over tunnel connections.
120
+
You can use those classes too if you're building on top of httpcore.
0 commit comments