<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>ProxyMesh Blog - httpx</title><link href="https://proxymesh.com/posts/" rel="alternate"/><link href="https://proxymesh.com/posts/feeds/tag-httpx.atom.xml" rel="self"/><id>https://proxymesh.com/posts/</id><updated>2026-11-16T00:00:00+00:00</updated><subtitle>Features, open-source releases, proxy and scraping news from ProxyMesh.</subtitle><entry><title>python-proxy-headers 0.2.5 requires Python 3.10 or later</title><link href="https://proxymesh.com/posts/python-proxy-headers-0-2-5/" rel="alternate"/><published>2026-11-16T00:00:00+00:00</published><updated>2026-11-16T00:00:00+00:00</updated><author><name>ProxyMesh</name></author><id>tag:proxymesh.com,2026-11-16:/posts/python-proxy-headers-0-2-5/</id><summary type="html">&lt;p&gt;python-proxy-headers 0.2.5 requires Python 3.10 or later, pins client extras, and raises ImportError on httpx 1.x. Python 3.8 and 3.9 stay on 0.2.4.&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;a href="https://github.com/proxymesh/python-proxy-headers"&gt;python-proxy-headers&lt;/a&gt; 0.2.5
requires Python 3.10 or later and doesn't support httpx 1.x. If you run Python
3.10 or newer, upgrade. If you use httpx, install the &lt;code&gt;[httpx]&lt;/code&gt; extra so you
stay on httpx 0.28.x. Typical request code doesn't need to change.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;-U&lt;span class="w"&gt; &lt;/span&gt;python-proxy-headers
pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;-U&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;python-proxy-headers[httpx]&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="python-310-or-newer-is-required"&gt;Python 3.10 or newer is required&lt;/h2&gt;
&lt;p&gt;0.2.5 needs Python 3.10 or newer. If you're on Python 3.8 or 3.9, stay on 0.2.4
and pin it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;python-proxy-headers==0.2.4&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="httpx-1x-is-not-supported"&gt;httpx 1.x is not supported&lt;/h2&gt;
&lt;p&gt;The httpx adapter needs httpx 0.28.x, and &lt;code&gt;httpcore&lt;/code&gt;, which that line uses for
proxy tunnels. httpx 1.0 removes proxy support, so importing
&lt;code&gt;python_proxy_headers.httpx_proxy&lt;/code&gt; on httpx 1.x raises an &lt;code&gt;ImportError&lt;/code&gt; that
starts with &lt;code&gt;python_proxy_headers.httpx_proxy requires httpx&amp;gt;=0.28,&amp;lt;1&lt;/code&gt; and
names the httpx version it found. If you installed an httpx 1.0 development
build, you will see it.&lt;/p&gt;
&lt;p&gt;To stay on a supported httpx, install the extra, which keeps httpx at
&lt;code&gt;&amp;gt;=0.28,&amp;lt;1&lt;/code&gt;. The &lt;a href="https://python-proxy-headers.readthedocs.io/en/latest/httpx.html"&gt;httpx page in the package docs&lt;/a&gt;
covers the adapter in full.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;python-proxy-headers[httpx]&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="install-your-client-as-an-extra"&gt;Install your client as an extra&lt;/h2&gt;
&lt;p&gt;You can now install the package together with your HTTP client as an extra, for
example &lt;code&gt;pip install 'python-proxy-headers[requests]'&lt;/code&gt;. The extra gives you a
version range of that client that the package is tested with.&lt;/p&gt;
&lt;h2 id="example-send-a-country-header-and-read-the-proxy-ip"&gt;Example: send a country header and read the proxy IP&lt;/h2&gt;
&lt;p&gt;The httpx adapter sends custom headers on the HTTPS CONNECT handshake and
returns the proxy's response headers on the response. Use the
&lt;a href="https://docs.proxymesh.com/article/80-proxy-server-locations"&gt;Proxy Server Locations article&lt;/a&gt;
to find the host and port for &lt;code&gt;PROXY_HOST:PORT&lt;/code&gt;. &lt;code&gt;X-ProxyMesh-Country&lt;/code&gt; works
only on the World and Open proxies.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;httpx&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;python_proxy_headers&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;httpx_proxy&lt;/span&gt;

&lt;span class="n"&gt;proxy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;httpx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Proxy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s1"&gt;&amp;#39;http://USERNAME:PASSWORD@PROXY_HOST:PORT&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;X-ProxyMesh-Country&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;US&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;httpx_proxy&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;https://api.ipify.org?format=json&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;X-ProxyMesh-IP&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Look for &lt;code&gt;X-ProxyMesh-IP&lt;/code&gt; in the printed output. The
&lt;a href="https://docs.proxymesh.com/article/7-request-response-headers"&gt;request and response headers article&lt;/a&gt;
lists every header ProxyMesh accepts and returns, and the
&lt;a href="https://docs.proxymesh.com/article/4-python-proxy-configuration"&gt;Python proxy configuration article&lt;/a&gt;
covers the other clients, including &lt;code&gt;requests&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Links: &lt;a href="https://pypi.org/project/python-proxy-headers/0.2.5/"&gt;python-proxy-headers 0.2.5 on PyPI&lt;/a&gt;,
the &lt;a href="https://github.com/proxymesh/python-proxy-headers/releases/tag/v0.2.5"&gt;GitHub release&lt;/a&gt;,
the &lt;a href="https://github.com/proxymesh/python-proxy-headers/compare/v0.2.4...v0.2.5"&gt;full diff from 0.2.4&lt;/a&gt;,
the &lt;a href="https://github.com/proxymesh/python-proxy-headers/blob/v0.2.5/CHANGELOG.md"&gt;changelog&lt;/a&gt;,
and the &lt;a href="https://python-proxy-headers.readthedocs.io/en/latest/"&gt;package documentation&lt;/a&gt;.&lt;/p&gt;</content><category term="Releases"/><category term="release"/><category term="python"/><category term="httpx"/></entry></feed>