From 5ead518b0500026b3c39552bca76a16976ebe51c Mon Sep 17 00:00:00 2001 From: Sohil Kshirsagar Date: Thu, 7 May 2026 17:19:31 -0700 Subject: [PATCH 1/2] fix: bundle socksio so httpx Client doesn't crash inside fence sandbox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit httpx evaluates proxy config eagerly inside Client.__init__ — when fence injects ALL_PROXY=socks5h://localhost:1080 and the customer's app constructs an httpx.Client at module load time, httpx tries to import socksio to build a SOCKS5 transport. Without socksio installed, the import raises and the WSGI/Flask app fails to start before serving a single request. Bundling socksio as a hard dep (~100KB, pure Python, MIT, zero transitive deps) covers every Python customer using httpx without any code or config change on their end. The SOCKS transport gets constructed but never serves a request — the SDK's monkey-patches on Client.send sit above the transport layer, so during replay the proxy is dormant. --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 85b5984..46f882c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,11 @@ dependencies = [ "opentelemetry-sdk>=1.20.0", "time-machine>=2.10.0", "typing_extensions>=4.4.0", + # Required so httpx.Client(...) construction doesn't crash inside the + # fence-based replay sandbox, which injects ALL_PROXY=socks5h://... into + # the service env. httpx evaluates proxy config eagerly in Client.__init__ + # and imports socksio to build a SOCKS5 transport at construction time. + "socksio", ] [project.optional-dependencies] From 0b50cf76f30b8db362cf00e3965645da12ae3360 Mon Sep 17 00:00:00 2001 From: Sohil Kshirsagar Date: Thu, 7 May 2026 17:42:48 -0700 Subject: [PATCH 2/2] fix(deps): add minimum version floor to socksio for project consistency --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 46f882c..fe32d59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ dependencies = [ # fence-based replay sandbox, which injects ALL_PROXY=socks5h://... into # the service env. httpx evaluates proxy config eagerly in Client.__init__ # and imports socksio to build a SOCKS5 transport at construction time. - "socksio", + "socksio>=1.0.0", ] [project.optional-dependencies]