Bläddra i källkod

Change default DOH to cloudflarte

tags/v2.1.9^2
9seconds 2 månader sedan
förälder
incheckning
36546cec2f
6 ändrade filer med 5 tillägg och 19 borttagningar
  1. 1
    1
      README.md
  2. 2
    2
      example.config.toml
  3. 1
    1
      internal/cli/simple_run.go
  4. 0
    3
      mtglib/internal/dc/view.go
  5. 0
    11
      mtglib/internal/dc/view_test.go
  6. 1
    1
      network/init.go

+ 1
- 1
README.md Visa fil

275
   -b, --tcp-buffer="4KB"               Size of TCP buffer to use.
275
   -b, --tcp-buffer="4KB"               Size of TCP buffer to use.
276
   -i, --prefer-ip="prefer-ipv6"        IP preference. By default we prefer IPv6 with fallback to IPv4.
276
   -i, --prefer-ip="prefer-ipv6"        IP preference. By default we prefer IPv6 with fallback to IPv4.
277
   -p, --domain-fronting-port=443       A port to access for domain fronting.
277
   -p, --domain-fronting-port=443       A port to access for domain fronting.
278
-  -n, --doh-ip=9.9.9.9                 IP address of DNS-over-HTTP to use.
278
+  -n, --doh-ip=1.1.1.1                 IP address of DNS-over-HTTP to use.
279
   -t, --timeout=10s                    Network timeout to use
279
   -t, --timeout=10s                    Network timeout to use
280
   -a, --antireplay-cache-size="1MB"    A size of anti-replay cache to use.
280
   -a, --antireplay-cache-size="1MB"    A size of anti-replay cache to use.
281
 ```
281
 ```

+ 2
- 2
example.config.toml Visa fil

93
 # resolver of the operating system and uses DOH instead. This is a host
93
 # resolver of the operating system and uses DOH instead. This is a host
94
 # it has to access.
94
 # it has to access.
95
 #
95
 #
96
-# By default we use Quad9.
97
-doh-ip = "9.9.9.9"
96
+# By default we use Cloudflare.
97
+doh-ip = "1.1.1.1"
98
 
98
 
99
 # mtg can work via proxies (for now, we support only socks5). Proxy
99
 # mtg can work via proxies (for now, we support only socks5). Proxy
100
 # configuration is done via list. So, you can specify many proxies
100
 # configuration is done via list. So, you can specify many proxies

+ 1
- 1
internal/cli/simple_run.go Visa fil

18
 	TCPBuffer           string        `kong:"name='tcp-buffer',short='b',default='4KB',help='Deprecated and ignored'"`                                                 //nolint: lll
18
 	TCPBuffer           string        `kong:"name='tcp-buffer',short='b',default='4KB',help='Deprecated and ignored'"`                                                 //nolint: lll
19
 	PreferIP            string        `kong:"name='prefer-ip',short='i',default='prefer-ipv6',help='IP preference. By default we prefer IPv6 with fallback to IPv4.'"` //nolint: lll
19
 	PreferIP            string        `kong:"name='prefer-ip',short='i',default='prefer-ipv6',help='IP preference. By default we prefer IPv6 with fallback to IPv4.'"` //nolint: lll
20
 	DomainFrontingPort  uint64        `kong:"name='domain-fronting-port',short='p',default='443',help='A port to access for domain fronting.'"`                        //nolint: lll
20
 	DomainFrontingPort  uint64        `kong:"name='domain-fronting-port',short='p',default='443',help='A port to access for domain fronting.'"`                        //nolint: lll
21
-	DOHIP               net.IP        `kong:"name='doh-ip',short='n',default='9.9.9.9',help='IP address of DNS-over-HTTP to use.'"`                                    //nolint: lll
21
+	DOHIP               net.IP        `kong:"name='doh-ip',short='n',default='1.1.1.1',help='IP address of DNS-over-HTTP to use.'"`                                    //nolint: lll
22
 	Timeout             time.Duration `kong:"name='timeout',short='t',default='10s',help='Network timeout to use'"`                                                    //nolint: lll
22
 	Timeout             time.Duration `kong:"name='timeout',short='t',default='10s',help='Network timeout to use'"`                                                    //nolint: lll
23
 	Socks5Proxies       []string      `kong:"name='socks5-proxy',short='s',help='Socks5 proxies to use for network access.'"`                                          //nolint: lll
23
 	Socks5Proxies       []string      `kong:"name='socks5-proxy',short='s',help='Socks5 proxies to use for network access.'"`                                          //nolint: lll
24
 	AntiReplayCacheSize string        `kong:"name='antireplay-cache-size',short='a',default='1MB',help='A size of anti-replay cache to use.'"`                         //nolint: lll
24
 	AntiReplayCacheSize string        `kong:"name='antireplay-cache-size',short='a',default='1MB',help='A size of anti-replay cache to use.'"`                         //nolint: lll

+ 0
- 3
mtglib/internal/dc/view.go Visa fil

2
 
2
 
3
 type dcView struct {
3
 type dcView struct {
4
 	overrides dcAddrSet
4
 	overrides dcAddrSet
5
-	collected dcAddrSet
6
 }
5
 }
7
 
6
 
8
 func (d dcView) getV4(dc int) []Addr {
7
 func (d dcView) getV4(dc int) []Addr {
9
 	addrs := d.overrides.getV4(dc)
8
 	addrs := d.overrides.getV4(dc)
10
 	addrs = append(addrs, defaultDCOverridesAddrSet.getV4(dc)...)
9
 	addrs = append(addrs, defaultDCOverridesAddrSet.getV4(dc)...)
11
-	// addrs = append(addrs, d.collected.getV4(dc)...)
12
 	addrs = append(addrs, defaultDCAddrSet.getV4(dc)...)
10
 	addrs = append(addrs, defaultDCAddrSet.getV4(dc)...)
13
 
11
 
14
 	return addrs
12
 	return addrs
17
 func (d dcView) getV6(dc int) []Addr {
15
 func (d dcView) getV6(dc int) []Addr {
18
 	addrs := d.overrides.getV6(dc)
16
 	addrs := d.overrides.getV6(dc)
19
 	addrs = append(addrs, defaultDCOverridesAddrSet.getV6(dc)...)
17
 	addrs = append(addrs, defaultDCOverridesAddrSet.getV6(dc)...)
20
-	// addrs = append(addrs, d.collected.getV6(dc)...)
21
 	addrs = append(addrs, defaultDCAddrSet.getV6(dc)...)
18
 	addrs = append(addrs, defaultDCAddrSet.getV6(dc)...)
22
 
19
 
23
 	return addrs
20
 	return addrs

+ 0
- 11
mtglib/internal/dc/view_test.go Visa fil

31
 				},
31
 				},
32
 			},
32
 			},
33
 		},
33
 		},
34
-		collected: dcAddrSet{
35
-			v4: map[int][]Addr{
36
-				1: {
37
-					{Network: "tcp4", Address: "127.1.0.1:443"},
38
-				},
39
-			},
40
-		},
41
 	}
34
 	}
42
 }
35
 }
43
 
36
 
54
 			{"tcp4", "149.154.167.51:443"},
47
 			{"tcp4", "149.154.167.51:443"},
55
 			{"tcp4", "95.161.76.100:443"},
48
 			{"tcp4", "95.161.76.100:443"},
56
 		},
49
 		},
57
-		1: {
58
-			{"tcp4", "127.1.0.1:443"},
59
-			{"tcp4", "149.154.175.50:443"},
60
-		},
61
 	}
50
 	}
62
 
51
 
63
 	for dc, addresses := range testData {
52
 	for dc, addresses := range testData {

+ 1
- 1
network/init.go Visa fil

63
 	// DefaultDOHHostname defines a default IP address for DOH host. Since mtg is
63
 	// DefaultDOHHostname defines a default IP address for DOH host. Since mtg is
64
 	// simple, please pass IP address here. We do not have bootstrap servers here
64
 	// simple, please pass IP address here. We do not have bootstrap servers here
65
 	// embedded.
65
 	// embedded.
66
-	DefaultDOHHostname = "9.9.9.9"
66
+	DefaultDOHHostname = "1.1.1.1"
67
 
67
 
68
 	// DNSTimeout defines a timeout for DNS queries.
68
 	// DNSTimeout defines a timeout for DNS queries.
69
 	DNSTimeout = 5 * time.Second
69
 	DNSTimeout = 5 * time.Second

Laddar…
Avbryt
Spara