Make clash api and gVisor optional

This commit is contained in:
世界
2022-07-20 07:12:40 +08:00
parent c5b3e8b042
commit 6ac1b395cf
9 changed files with 49 additions and 16 deletions

18
adapter/experimental.go Normal file
View File

@@ -0,0 +1,18 @@
package adapter
import (
"context"
"net"
N "github.com/sagernet/sing/common/network"
)
type ClashServer interface {
Service
TrafficController
}
type TrafficController interface {
RoutedConnection(ctx context.Context, conn net.Conn, metadata InboundContext, matchedRule Rule) net.Conn
RoutedPacketConnection(ctx context.Context, conn N.PacketConn, metadata InboundContext, matchedRule Rule) N.PacketConn
}