Skip to content

Bypass mode: DNS with no server, the ladder in the bridge, and connecting with no server - #12

Open
limeflash wants to merge 5 commits into
mainfrom
bypass-dns
Open

limeflash wants to merge 5 commits into
mainfrom
bypass-dns

Conversation

@limeflash

Copy link
Copy Markdown
Contributor

Steps 7–9 of the serverless DPI bypass: the mode bypass now connects with no VPN server.

Step 7: DNS with no server (9e02481, 3a94495)

  • A chain of resolvers: DoH by address (1.1.1.1, 8.8.8.8), plain UDP to public resolvers, then the physical interface's own. Answers are graded: SERVFAIL, REFUSED and truncated ones go on to the next step; stub answers and NXDOMAIN go on too, and the best one seen comes back when nothing better does, so local and company names keep working.
  • Only DoH steps stick. At most 64 questions at once; a failure is answered with SERVFAIL. DNS over TCP is served too.
  • With no server, names the bypass works on get no HTTPS record.

Step 8: the ladder in the bridge (e4d24ff, 3a94495)

  • TLS flows with a name that go direct are opened through mistgate-bypass flow.Open, with an optional fallback to the VPN.
  • QUIC to names whose QUIC the set turns off is refused, so browsers fall back to TCP.
  • In smart, names of the bypass selection go direct while the bypass is in force; the VPN selection still wins.

Step 9: the mode with no server (1fbee54, 1c2319d)

  • Start with mode: bypass brings up the adapter with no server route and the firewall in its DNS-only form, and every flow goes direct. Rules read as in smart: the direct selection are exceptions, the block list blocks.
  • The ladder's memory lives in bypass-memory.json in the data directory. It is told the network before the first flow and on every change, and saved once a minute.
  • Probe passes a bypass run (it fails without a default route), and the route is bypass.
  • Session: a switch to the bypass does not hold the network, and Auto's measuring and reporting stay out of a bypass session.
  • TCP that would go to a VPN (private addresses beyond the gateway, IPv6) goes direct, so IPv6 works where the machine has it.
  • Also fixes the routes.check row of docs/ipc.md, broken since the bypass selection was added.

Not in this PR: delivery of newer strategy sets, IPC bypass.*, the fast and deep tiers, the ladder in VPN modes (bypass_direct), UDP to private addresses in the bypass, and the local proxy in the bypass.

Checks: go vet ./... and go test ./... pass on Windows; go vet ./internal/... passes for darwin/arm64. Every step had independent reviews (Opus and Codex), and their findings are fixed in these commits. The adapter path has not run on a real machine yet; that needs the test VM.

🤖 Generated with Claude Code

limeflash and others added 5 commits December 3, 2026 13:50
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and bypass names direct in smart

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The chain grades answers: SERVFAIL, REFUSED and truncated ones go on to the
  next step; NXDOMAIN and stub answers go on too, and the best one seen comes
  back when nothing better does (local and company names keep working).
- Only DoH steps stick; a plain UDP answer can be forged on the path.
- A DoH step is not rested when the question was cancelled.
- At most 64 questions at once; DNS over TCP lives on the run's context,
  answers in one write, and both UDP and TCP get SERVFAIL instead of silence.
- QUIC is refused before the program is known and without asking the route:
  the pump must not wait, and a refused flow only falls back to TCP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start in mode "bypass" brings up the adapter with no server route and
the firewall in its DNS-only form, and a bridge whose "VPN" is the DNS
chain: every flow goes direct, TLS with a name through the ladder (no
fallback), QUIC refused for the names whose QUIC the set turns off, and
HTTPS records dropped for the names the bypass works on. Rules read as
in smart: the direct selection are exceptions, the block list blocks.

The ladder's memory is opened once per service (bypass-memory.json in
the data directory), told the network at start and at every sign of a
change, and saved once a minute and when the run ends. Probe passes a
bypass run, EffectiveRoute and RoutePath say "bypass", and the geo
store gets the set's services as its catalogue.

Also fixes the routes.check row of docs/ipc.md, broken since the
bypass selection was added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Session:
- A switch to the bypass (or a new attempt in it) does not hold the
  network; a DNS change does not reconnect the bypass, which reads none.
- Auto's machinery stays out of a bypass session: no Auto mark in the
  status, no measuring, proofs or round of servers, no dead path "".

Engine:
- TCP the bridge would send to a VPN goes direct in the bypass: private
  addresses beyond the gateway open, and the IPv6 probe now finds out
  whether the machine has IPv6 instead of turning it off.
- The memory is told the network before the first flow, and again on a
  new network (then the country is found again) or every 10 minutes at
  most; the manager's probes wake the run, and a probe without a
  default route fails so that the session waits for a network.
- DNS flows read the bypass settings at each question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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