Inbound rule support

This commit is contained in:
世界
2022-07-02 14:07:50 +08:00
parent 737a61be66
commit 0e9bd9b091
34 changed files with 622 additions and 247 deletions

View File

@@ -12,4 +12,11 @@ type Router interface {
Outbound(tag string) (Outbound, bool)
RouteConnection(ctx context.Context, conn net.Conn, metadata InboundContext) error
RoutePacketConnection(ctx context.Context, conn N.PacketConn, metadata InboundContext) error
Close() error
}
type Rule interface {
Match(metadata InboundContext) bool
Outbound() string
String() string
}