github.com/sagernet/sing-box@v1.9.0-rc.20/adapter/v2ray.go (about) 1 package adapter 2 3 import ( 4 "context" 5 "net" 6 7 E "github.com/sagernet/sing/common/exceptions" 8 N "github.com/sagernet/sing/common/network" 9 ) 10 11 type V2RayServerTransport interface { 12 Network() []string 13 Serve(listener net.Listener) error 14 ServePacket(listener net.PacketConn) error 15 Close() error 16 } 17 18 type V2RayServerTransportHandler interface { 19 N.TCPConnectionHandler 20 E.Handler 21 } 22 23 type V2RayClientTransport interface { 24 DialContext(ctx context.Context) (net.Conn, error) 25 }