Add clash mode support

This commit is contained in:
世界
2022-09-10 14:09:47 +08:00
parent 80cfc9a25b
commit 5297273937
12 changed files with 98 additions and 23 deletions

View File

@@ -9,18 +9,15 @@ import (
type ClashServer interface {
Service
TrafficController
Mode() string
RoutedConnection(ctx context.Context, conn net.Conn, metadata InboundContext, matchedRule Rule) (net.Conn, Tracker)
RoutedPacketConnection(ctx context.Context, conn N.PacketConn, metadata InboundContext, matchedRule Rule) (N.PacketConn, Tracker)
}
type Tracker interface {
Leave()
}
type TrafficController interface {
RoutedConnection(ctx context.Context, conn net.Conn, metadata InboundContext, matchedRule Rule) (net.Conn, Tracker)
RoutedPacketConnection(ctx context.Context, conn N.PacketConn, metadata InboundContext, matchedRule Rule) (N.PacketConn, Tracker)
}
type OutboundGroup interface {
Now() string
All() []string