Add multiplexer

This commit is contained in:
世界
2022-07-30 00:29:22 +08:00
parent 83154eadd3
commit 457de86819
47 changed files with 1244 additions and 174 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/sagernet/sing/common"
E "github.com/sagernet/sing/common/exceptions"
F "github.com/sagernet/sing/common/format"
N "github.com/sagernet/sing/common/network"
)
func NewRule(router adapter.Router, logger log.ContextLogger, options option.Rule) (adapter.Rule, error) {
@@ -73,7 +74,7 @@ func NewDefaultRule(router adapter.Router, logger log.ContextLogger, options opt
}
if options.Network != "" {
switch options.Network {
case C.NetworkTCP, C.NetworkUDP:
case N.NetworkTCP, N.NetworkUDP:
item := NewNetworkItem(options.Network)
rule.items = append(rule.items, item)
rule.allItems = append(rule.allItems, item)