Skip to content

fix(device-client): never use a proxy from the environment - #137

Merged
kinqsradio merged 1 commit into
mainfrom
fix/no-proxy
Nov 12, 2026
Merged

kinqsradio merged 1 commit into
mainfrom
fix/no-proxy

Conversation

@kinqsradio

Copy link
Copy Markdown
Member

Summary

  • Found by trying it: with HTTP_PROXY (or ALL_PROXY, HTTPS_PROXY) set, a request through HttpApi to a loopback engine went to the proxy, bearer token included (the child got the proxy's 502). reqwest reads those variables by default and does not exempt loopback.
  • HttpApi now builds its client with .no_proxy(). Redirects were already off.
  • Test tests/no_proxy.rs: runs the test binary again as a child with the proxy variables set (and a NO_PROXY that does not name the engine) to a second listener; the proxy must get no connection and the engine must get the request. Without .no_proxy() the test fails.
  • docs/device-client.md states the rule and lists the test.
  • Trade-off: a machine that can reach the engine only through a proxy cannot use this client until a proxy setting is designed; the owner should know before an https engine is behind one.

Testing

  • Full gate with Postgres: fmt, clippy, structure, wasm32, workspace tests (999 pass).
  • Mutation: removing .no_proxy() makes a_proxy_in_the_environment_never_sees_a_request_to_the_engine fail.
  • Not tested: the CI clippy toolchain (local only).

Co-authors

none

AI usage

  • Written by hand, with no AI
  • Harness and version: Claude Code 2.1.317
  • Models: claude-sonnet-5-5 (all)
  • Effort: medium
  • Human role: set scope (reviewer's note on the builder)
  • Sources: none

Checklist

  • Works on Windows, macOS and Linux
  • docs/architecture.md with any rule change; generated wire types with any contract change
  • No copied source, secrets, credentials or personal data; no AI attribution in commits, title or branch

…ironment

reqwest reads HTTP_PROXY, HTTPS_PROXY and ALL_PROXY by default and does
not exempt loopback, so a request carrying the bearer token went to the
proxy a machine named, even for 127.0.0.1. The client now sets no_proxy.
A test runs the test binary as a child with the proxy variables set and
checks that the proxy gets no connection.
@kinqsradio
kinqsradio merged commit db006e3 into main Nov 12, 2026
17 checks passed
@kinqsradio
kinqsradio deleted the fix/no-proxy branch November 12, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant