Skip to content

Add no_proxy support#40

Merged
liquidsec merged 4 commits into
devfrom
no-proxy-support
Jun 3, 2026
Merged

Add no_proxy support#40
liquidsec merged 4 commits into
devfrom
no-proxy-support

Conversation

@liquidsec

Copy link
Copy Markdown
Collaborator

Adds a no_proxy option so requests to specific hosts bypass the configured proxy (the NO_PROXY equivalent).

no_proxy is a per-request list, exposed on request(), download(), raw_connect(), BatchConfig, and the --no-proxy CLI flag. Each entry matches:

  • exact hostname (case-insensitive)
  • domain suffix: *.corp, .corp, or corp (matches the domain itself and any subdomain)
  • single IP (127.0.0.1, ::1)
  • CIDR (10.0.0.0/8, fd00::/8)
  • * for all hosts

Matching happens at the connection-mode decision, so it applies to both the pooled hyper path and the raw connect_stream path. When a host matches, the request connects directly as if no proxy were set.

Bumps version to 0.8.0.

Per-request no_proxy list that bypasses the configured proxy. Matches
exact hostnames, domain suffixes (*.corp), IPs, and CIDRs. Exposed on
request/download/raw_connect/BatchConfig and the --no-proxy CLI flag.
Bump to 0.8.0.
@liquidsec
liquidsec requested a review from ausmaster June 1, 2026 22:25
liquidsec added 2 commits June 1, 2026 20:08
Compare host against suffixes on bytes via eq_ignore_ascii_case instead
of lowercasing the host and building a format! string per pattern. Runs
per request when a proxy is set.
The connection mode (direct vs forward-proxy/tunnel/socks5) was decided once before the redirect loop, so a cross-host redirect kept the first URL's decision. With no_proxy set this could route a redirected request directly past the proxy, or send a no_proxy host through the proxy.

Move the conn_mode decision inside the redirect loop so it is recomputed against each hop's host. Clients are still cached per mode, so hops that share a mode reuse the same client.

Add CLI (tests/cli_no_proxy.rs) and Python-binding (tests/python/test_no_proxy.py) regression tests covering both directions of a cross-host redirect.
@liquidsec
liquidsec merged commit 82f31ed into dev Jun 3, 2026
15 checks passed
@liquidsec
liquidsec deleted the no-proxy-support branch June 29, 2026 20:04
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.

2 participants