Add preferred_by route rule item

This commit is contained in:
世界
2025-08-15 12:45:06 +08:00
parent 5be1887f92
commit 239e6ec701
9 changed files with 194 additions and 19 deletions

View File

@@ -2,6 +2,7 @@ package adapter
import (
"context"
"net/netip"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
@@ -18,6 +19,11 @@ type Outbound interface {
N.Dialer
}
type OutboundWithPreferredRoutes interface {
PreferredDomain(domain string) bool
PreferredAddress(address netip.Addr) bool
}
type OutboundRegistry interface {
option.OutboundOptionsRegistry
CreateOutbound(ctx context.Context, router Router, logger log.ContextLogger, tag string, outboundType string, options any) (Outbound, error)