ac4af582301a4e8a29245dbba767eba31334ddf9
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
cf5a6f9cfd |
gui: the proxy test says a TUN may share one exit when the proxy took the request, not "no proxy" (#2369, Emt-lin)
The proxy test compared the exit IP through the proxy with the direct one,
and called the same address "they leave as if there were no proxy". Under
a TUN or system VPN every request leaves from one exit, so a working proxy
read as not in effect.
The leg through the proxy now records what it can see: the connection that
carried it (httptrace GotConn's RemoteAddr) and the proxy netproxy chose for
the URL. It is Proxied when that connection is the proxy's (same port, the
default by scheme; the host as an IP or resolved). With the same exit IP:
- Proxied: "The proxy took the requests, but they leave from {where} as
direct ones do: a TUN or system VPN may send every request out one exit,
so the address can't tell the two paths apart" (not a failure);
- not Proxied (bypassed by NO_PROXY or the system bypass list): "...didn't
connect to it ...: the proxy is passed by" (a failure).
The verdict is made only in app.js's proxyCheckText; no CLI, TUI or plugin
path makes it.
Run:
- go test -race -count=3 -run TestProxyCheck ./internal/gui/: ok.
New: TestProxyCheckSaysTheProxyTookItUnderOneExit (the proxy answers with
the direct leg's IP), TestProxyCheckSaysAProxyPassedBy (NO_PROXY),
TestProxyCheckConnectedToByName; TellsTheProxyFromDirect also checks
Proxied.
- Broken by hand: no Proxied assignment turns TellsTheProxyFromDirect and
SaysTheProxyTookItUnderOneExit red; Proxied always true turns
SaysAProxyPassedBy red; origin/main's app.js turns proxy-test's
"one-exit" case red.
- GUI: proxy-test.test.cjs 22/22 in Chromium and WebKit (1100 and 420, en,
zh, zh-TW, ja, de); gui-de, gui-ja, gui-zh-tw, i18n-keys 12/12.
- Real use: a local CONNECT proxy named by localhost, to the real
Cloudflare trace: through Proxied true, direct Proxied false, one
CONNECT, the same exit both ways (the reporter's case). A real TUN was
not tried.
- gofmt -l clean; go vet ./... (darwin), GOOS=linux and GOOS=windows
go vet -tags nogui ./..., and GOOS=windows go vet ./...: ok.
- Not fixed here: at 420px the proxy row's mode control overlaps a long
check line; origin/main's "down" message does the same.
Suite run here: HOME=<sandbox> go test -tags nogui -timeout 45m ./...: 62 ok,
internal/gateway FAIL only on TestOTelFastRequestTranscriptDiscovery/true
("request must still have a cached discovery miss"), open as #1811 (red
under load; load average ~170 here); it and its sibling pass -count=3
alone.
Full suite: SUITE_LINE
|
||
|
|
536b15a8e9 |
gui: Settings › Proxy has a Test that says whether requests leave through it (#2076)
c4ex: the proxy setting gave no way to see whether it takes effect, and
suggested asking a Cloudflare address.
What changed:
- POST /api/proxy/check (proxycheck.go) asks Cloudflare's trace page
(www.cloudflare.com/cdn-cgi/trace) twice at once, 10s each: once as a
vendor request without a proxy of its own goes (http.DefaultClient,
netproxy's Settings / *_PROXY / system proxy), once direct
(netproxy.With "direct"). Each answer is the ip= and loc= Cloudflare saw,
and the ms. With no proxy in force (source off/none) only the direct one
is made. The proxy is reported redacted (Describe); a failure's text has
user:password taken out.
- The Proxy row gets a Test button; the result goes on a line under the
row's text: works (two addresses), the same address both ways (shown as
a failure: the proxy isn't taking the requests), the proxy failing (with
the direct address), no proxy in force, the check failing. Testing… while
it runs; the result outlives a redraw and goes when the proxy changes.
Strings in zh, zh-TW, ja, de.
Decision (delegated): compare against a direct request rather than only
show the proxied address, since an address alone can't say whether the
proxy was used; Cloudflare's trace page as the reporter suggested (plain
text, no account, served worldwide).
Run:
- go test ./internal/gui -run TestProxyCheck: 5 tests (proxy vs direct;
no proxy asks only direct; a refusing proxy, password not in the error;
a page with no ip= fails; ALL_PROXY global proxy is gone around for the
direct leg). All loopback/.invalid, nothing leaves the machine. Broke
the direct leg's With("direct"): the global-proxy test goes red ("the
proxy asked 2 times").
- go test ./internal/gui -count=1: all pass except TestMainWindowCorners,
the load red filed as #1936 (same on origin/main).
- New proxy-test.test.cjs (5 languages x 1100/420, 6 cases each): chromium
11/11, webkit 11/11; with the same-address branch broken 0/11.
- proxy-test, settings-proxy-auth, proxy-own-wording, i18n-keys and six
settings-* tests: chromium 63/63; webkit 62/63, the red being
settings-proxy-auth zh once under the 2-wide run; it passed alone 5/5
and three more 2-wide runs with proxy-test 3x0 fails (noted on #2142).
- gofmt -l clean; go vet darwin, linux -tags nogui, windows clean.
Tried: checkProxy against the real www.cloudflare.com trace page, direct
leg only, from a temporary test (not committed): ip and loc read, 1.2s.
Not tried: a real proxy (Settings, *_PROXY or system) through to it.
|