mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-03 17:57:30 +03:00
refactor: Extract services form router
This commit is contained in:
@@ -19,7 +19,7 @@ import (
|
||||
)
|
||||
|
||||
type Router interface {
|
||||
NewService
|
||||
Lifecycle
|
||||
|
||||
FakeIPStore() FakeIPStore
|
||||
|
||||
@@ -38,15 +38,16 @@ type Router interface {
|
||||
ClearDNSCache()
|
||||
Rules() []Rule
|
||||
|
||||
ClashServer() ClashServer
|
||||
SetClashServer(server ClashServer)
|
||||
|
||||
V2RayServer() V2RayServer
|
||||
SetV2RayServer(server V2RayServer)
|
||||
SetTracker(tracker ConnectionTracker)
|
||||
|
||||
ResetNetwork()
|
||||
}
|
||||
|
||||
type ConnectionTracker interface {
|
||||
RoutedConnection(ctx context.Context, conn net.Conn, metadata InboundContext, matchedRule Rule, matchOutbound Outbound) net.Conn
|
||||
RoutedPacketConnection(ctx context.Context, conn N.PacketConn, metadata InboundContext, matchedRule Rule, matchOutbound Outbound) N.PacketConn
|
||||
}
|
||||
|
||||
// Deprecated: Use ConnectionRouterEx instead.
|
||||
type ConnectionRouter interface {
|
||||
RouteConnection(ctx context.Context, conn net.Conn, metadata InboundContext) error
|
||||
|
||||
Reference in New Issue
Block a user