Skip to content

Add domain whitelist routing to Socks5/HTTP/SNI proxies - #220

Open
ericbear wants to merge 1 commit into
windtf:masterfrom
ericbear:feat/domain-whitelist-routing
Open

Add domain whitelist routing to Socks5/HTTP/SNI proxies#220
ericbear wants to merge 1 commit into
windtf:masterfrom
ericbear:feat/domain-whitelist-routing

Conversation

@ericbear

Copy link
Copy Markdown

Adds an optional TunnelDomains regex whitelist to the hostname-aware proxy listeners. When set, only connections whose destination host matches a pattern are routed through WireGuard; everything else is dialed directly, giving per-domain split tunneling inside wireproxy. When unset, all traffic is tunneled as before (no regression).

Each TunnelDomains line is one full Go regex (repeat the key for multiple patterns) so quantifiers like {2,4} survive; invalid patterns fail --configtest. A per-section LogDomains bool logs each connection's host and its TUNNEL/DIRECT decision so users can discover which domains to whitelist.

SOCKS5 keeps the original FQDN via a passthrough resolver plus WithDialAndRequest so routing decisions use the hostname the client asked for; the legacy WithDial/WithResolver path is kept when routing and logging are both off.

Adds an optional TunnelDomains regex whitelist to the hostname-aware proxy
listeners. When set, only connections whose destination host matches a
pattern are routed through WireGuard; everything else is dialed directly,
giving per-domain split tunneling inside wireproxy. When unset, all traffic
is tunneled as before (no regression).

Each TunnelDomains line is one full Go regex (repeat the key for multiple
patterns) so quantifiers like {2,4} survive; invalid patterns fail
--configtest. A per-section LogDomains bool logs each connection's host and
its TUNNEL/DIRECT decision so users can discover which domains to whitelist.

SOCKS5 keeps the original FQDN via a passthrough resolver plus
WithDialAndRequest so routing decisions use the hostname the client asked
for; the legacy WithDial/WithResolver path is kept when routing and logging
are both off.
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