speed up ping
This commit is contained in:
6
build_windows.bat
Normal file
6
build_windows.bat
Normal file
@@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
set GOOS=windows
|
||||
set GOARCH=amd64
|
||||
set CC=x86_64-w64-mingw32-gcc
|
||||
set CGO_ENABLED=1
|
||||
go build -trimpath -tags with_gvisor,with_quic,with_wireguard,with_ech,with_utls,with_clash_api,with_grpc -ldflags="-w -s" -buildmode=c-shared -o bin/libcore.dll ./custom
|
||||
@@ -80,7 +80,7 @@ func BuildConfig(configOpt ConfigOptions, input option.Options) (*option.Options
|
||||
Address: configOpt.RemoteDnsAddress,
|
||||
AddressResolver: "dns-direct",
|
||||
Strategy: configOpt.RemoteDnsDomainStrategy,
|
||||
Detour: "proxy",
|
||||
Detour: "select",
|
||||
},
|
||||
{
|
||||
Tag: "dns-direct",
|
||||
@@ -175,7 +175,7 @@ func BuildConfig(configOpt ConfigOptions, input option.Options) (*option.Options
|
||||
Listen: option.NewListenAddress(netip.MustParseAddr(bind)),
|
||||
ListenPort: configOpt.LocalDnsPort,
|
||||
},
|
||||
OverrideAddress: "8.8.8.8",
|
||||
OverrideAddress: "1.1.1.1",
|
||||
OverridePort: 53,
|
||||
},
|
||||
},
|
||||
@@ -261,6 +261,20 @@ func BuildConfig(configOpt ConfigOptions, input option.Options) (*option.Options
|
||||
},
|
||||
},
|
||||
)
|
||||
var dnsCPttl uint32 = 300000
|
||||
|
||||
options.DNS.Rules = append(
|
||||
options.DNS.Rules,
|
||||
option.DNSRule{
|
||||
Type: C.RuleTypeDefault,
|
||||
DefaultOptions: option.DefaultDNSRule{
|
||||
Domain: []string{"cp.cloudflare.com"},
|
||||
Server: "dns-remote",
|
||||
RewriteTTL: &dnsCPttl,
|
||||
DisableCache: false,
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
for _, rule := range configOpt.Rules {
|
||||
|
||||
@@ -71,7 +71,7 @@ func DefaultConfigOptions() *ConfigOptions {
|
||||
MTU: 9000,
|
||||
StrictRoute: true,
|
||||
TUNStack: "mixed",
|
||||
ConnectionTestUrl: "https://cp.cloudflare.com/",
|
||||
ConnectionTestUrl: "http://cp.cloudflare.com/",
|
||||
URLTestInterval: option.Duration(10 * time.Minute),
|
||||
URLTestIdleTimeout: option.Duration(100 * time.Minute),
|
||||
EnableClashApi: true,
|
||||
|
||||
Reference in New Issue
Block a user