feat: domain_strategy

This commit is contained in:
cubemaze 2023-08-28 15:24:28 +08:00
parent 13208c0541
commit 5645d3d3c7
3 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,9 @@
package conf
import (
"github.com/inazumav/sing-box/option"
)
type SingConfig struct {
LogConfig SingLogConfig `json:"Log"`
NtpConfig SingNtpConfig `json:"NTP"`
@ -31,6 +35,7 @@ type SingOptions struct {
EnableProxyProtocol bool `json:"EnableProxyProtocol"`
TCPFastOpen bool `json:"EnableTFO"`
SniffEnabled bool `json:"EnableSniff"`
DomainStrategy option.DomainStrategy `json:"DomainStrategy"`
SniffOverrideDestination bool `json:"SniffOverrideDestination"`
FallBackConfigs *FallBackConfigForSing `json:"FallBackConfigs"`
}

View File

@ -38,6 +38,7 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio
InboundOptions: option.InboundOptions{
SniffEnabled: c.SingOptions.SniffEnabled,
SniffOverrideDestination: c.SingOptions.SniffOverrideDestination,
DomainStrategy: c.SingOptions.DomainStrategy,
},
}
var tls option.InboundTLSOptions

View File

@ -63,7 +63,12 @@
// Proxy Protocol https://github.com/haproxy/haproxy/blob/master/doc/proxy-protocol.txt
"EnableProxyProtocol": false,
// TCP Fast Open
"EnableTFO": true
"EnableTFO": true,
// Domain Strategy
// prefer_ipv4 / prefer_ipv6 / ipv4_only / ipv6_only
"DomainStrategy": "ipv4_only",
// More
}
/*,
@ -81,6 +86,7 @@
"Core": "sing",
"EnableProxyProtocol": true,
"EnableTFO": true
"DomainStrategy": "ipv4_only",
}
},
{