Fixes #439. When `[network] dns = "tls://..."` (or "https://...") is set, the resulting *net.Resolver gets attached to the base network's NativeDialer and was previously also handed to golang.org/x/net/proxy.FromURL via NewProxyNetwork. As a result, the SOCKS5 client used the user's DoT/DoH resolver to look up the SOCKS server's own hostname (e.g. "xray" inside a docker compose stack). Public DNS-over-TLS resolvers don't know about docker-compose service names, k8s service DNS, /etc/hosts entries, or corporate split-horizon DNS, so the upstream lookup returned NXDOMAIN and the proxy chain broke with a misleading "lookup xray on 127.0.0.11:53: no such host" error. The custom DNS resolver exists to bypass DPI poisoning when resolving public censored names like Telegram DCs or the SNI/fronting host. Proxy server addresses are almost always internal and should be resolved via the system resolver instead. This change introduces proxyServerDialer, which copies the timeout and fallback-delay from the base dialer but leaves Resolver==nil, and uses it for the SOCKS upstream. The new internal test asserts the structural property directly: the returned dialer must not inherit the base's custom resolver.pull/483/head
|
|
||
| 3 |
|
3 |
|
| 4 |
|
4 |
|
| 5 |
|
5 |
|
|
6 |
|
|
| 6 |
|
7 |
|
| 7 |
|
8 |
|
| 8 |
|
9 |
|
|
|
||
| 39 |
|
40 |
|
| 40 |
|
41 |
|
| 41 |
|
42 |
|
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
|
|
| 42 |
|
58 |
|
| 43 |
|
|
|
|
59 |
|
|
| 44 |
|
60 |
|
| 45 |
|
61 |
|
| 46 |
|
62 |
|
|
|
||
|
1 |
|
|
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
|