2022-07-19 14:16:49 +00:00
|
|
|
package adapter
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"net"
|
|
|
|
|
|
|
|
N "github.com/sagernet/sing/common/network"
|
|
|
|
)
|
|
|
|
|
2022-07-19 23:12:40 +00:00
|
|
|
type ClashServer interface {
|
|
|
|
Service
|
|
|
|
TrafficController
|
|
|
|
}
|
|
|
|
|
2022-07-19 14:16:49 +00:00
|
|
|
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
|
|
|
|
}
|
2022-07-22 05:51:08 +00:00
|
|
|
|
|
|
|
type OutboundGroup interface {
|
|
|
|
Now() string
|
|
|
|
All() []string
|
|
|
|
}
|