better tunnel management and cache dns of url test

This commit is contained in:
Hiddify
2024-08-02 08:29:13 +02:00
parent b7e82e7f5c
commit e9a3396024
4 changed files with 46 additions and 31 deletions

View File

@@ -39,6 +39,9 @@ func makeTunnelConfig(Ipv6 bool, ServerPort int32, StrictRoute bool, EndpointInd
ipv6 = ""
}
base := `{
"log":{
"level": "warn"
},
"inbounds": [
{
"type": "tun",
@@ -46,7 +49,7 @@ func makeTunnelConfig(Ipv6 bool, ServerPort int32, StrictRoute bool, EndpointInd
"interface_name": "HiddifyTunnel",
"inet4_address": "172.19.0.1/30",
` + ipv6 + `
"mtu": 9000,
"mtu": 1492,
"auto_route": true,
"strict_route": ` + fmt.Sprintf("%t", StrictRoute) + `,
"endpoint_independent_nat": ` + fmt.Sprintf("%t", EndpointIndependentNat) + `,
@@ -67,21 +70,16 @@ func makeTunnelConfig(Ipv6 bool, ServerPort int32, StrictRoute bool, EndpointInd
}
],
"route": {
"auto_detect_interface": true,
"rules": [
{
"process_name":"Hiddify.exe",
"outbound": "direct-out"
},
{
"process_name":"Hiddify",
"outbound": "direct-out"
},
{
"process_name":"HiddifyCli",
"outbound": "direct-out"
},
{
"process_name":"HiddifyCli.exe",
"process_name":[
"Hiddify.exe",
"Hiddify",
"HiddifyCli",
"HiddifyCli.exe"
],
"outbound": "direct-out"
}
]