quantum_lsfc's network sends a company's domains to an internal L4 SNI
gateway; an IP in the base URL fails the certificate and /etc/hosts
can't be edited there. WithResolve puts host -> places on a request's
context; Dispatch keeps a transport per rule whose DialContext connects
that host to the places in order (an IP, ip:port, or dns:<name> looked
up at each connection), each given 8s, then the name as usual. The URL's
name stays the TLS server name and Host. A request through a proxy is
left alone: the proxy gets CONNECT with the name. CheckResolve bounds
and checks a rule.
Broken by hand: dialling the name and ignoring the places turns
TestResolveKeepsNameForSNIAndHost, TestResolvePlaceWithPort,
TestResolveDNSPlaceFollowsItsRecords, TestResolveOrderedFailover and
TestResolveFallsBackToDirect red; dropping the direct-only check turns
TestResolveLeavesAProxyOfTheSameNameAlone red.
Run on mote at the head rebased on origin/main b942a872b: go test
-count=1 -timeout 45m ./internal/netproxy ./internal/provider
./internal/gateway ./internal/gui, all ok; gofmt -l clean; go vet ./...
for darwin, linux (-tags nogui) and windows ok; provider-resolve.test.cjs
(chromium and webkit; en zh zh-TW ja de; 1100 and 420) 60 of 60 ok.
Rebased again on origin/main dea131174 and run on mote:
netproxy, provider and gui (TestCoreScriptBudget) ok, gofmt and the
three vets ok, provider-resolve 60 of 60 and i18n-keys ok; internal/gateway was
not run again at that head (no new main commit touches the offline
check or the dial).
The 94 GUI files the editor's Save, Test and certificate rows reach,
run at origin/main 436d507f0: 88 reds in 15 files, the same tests red
on that main run alone (filed: #6424, and #6010#6156#5838#4621#4391#5147#6030#6209#4397#4673#6099).
Not tried: a real managed network with an L4 SNI gateway (the
reporter's), and the rule's dial on Windows or Linux beyond go vet.