Refactor struct & Add override dialer options

This commit is contained in:
世界
2022-07-03 20:59:25 +08:00
parent 28b865acf0
commit 18e3f43df3
33 changed files with 282 additions and 166 deletions

23
route/rule_network.go Normal file
View File

@@ -0,0 +1,23 @@
package route
import (
"github.com/sagernet/sing-box/adapter"
)
var _ RuleItem = (*NetworkItem)(nil)
type NetworkItem struct {
network string
}
func NewNetworkItem(network string) *NetworkItem {
return &NetworkItem{network}
}
func (r *NetworkItem) Match(metadata *adapter.InboundContext) bool {
return r.network == metadata.Network
}
func (r *NetworkItem) String() string {
return "network=" + r.network
}