1
0
Fork 0
mirror of https://github.com/SagerNet/sing-box.git synced 2025-04-06 05:17:37 +03:00

Fix override address

This commit is contained in:
世界 2025-02-02 23:17:31 +08:00
parent 4eed46ac59
commit 9db2d58545
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
3 changed files with 25 additions and 1 deletions
route/rule

View file

@ -162,6 +162,24 @@ func (r *RuleActionRouteOptions) Type() string {
func (r *RuleActionRouteOptions) String() string {
var descriptions []string
if r.OverrideAddress.IsValid() {
descriptions = append(descriptions, F.ToString("override-address=", r.OverrideAddress.AddrString()))
}
if r.OverridePort > 0 {
descriptions = append(descriptions, F.ToString("override-port=", r.OverridePort))
}
if r.NetworkStrategy != nil {
descriptions = append(descriptions, F.ToString("network-strategy=", r.NetworkStrategy))
}
if r.NetworkType != nil {
descriptions = append(descriptions, F.ToString("network-type=", strings.Join(common.Map(r.NetworkType, C.InterfaceType.String), ",")))
}
if r.FallbackNetworkType != nil {
descriptions = append(descriptions, F.ToString("fallback-network-type="+strings.Join(common.Map(r.NetworkType, C.InterfaceType.String), ",")))
}
if r.FallbackDelay > 0 {
descriptions = append(descriptions, F.ToString("fallback-delay=", r.FallbackDelay.String()))
}
if r.UDPDisableDomainUnmapping {
descriptions = append(descriptions, "udp-disable-domain-unmapping")
}