mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-14 12:53:17 +00:00
26 lines
472 B
Go
26 lines
472 B
Go
package adapter
|
|
|
|
import (
|
|
"context"
|
|
"net"
|
|
|
|
E "github.com/sagernet/sing/common/exceptions"
|
|
N "github.com/sagernet/sing/common/network"
|
|
)
|
|
|
|
type V2RayServerTransport interface {
|
|
Network() []string
|
|
Serve(listener net.Listener) error
|
|
ServePacket(listener net.PacketConn) error
|
|
Close() error
|
|
}
|
|
|
|
type V2RayServerTransportHandler interface {
|
|
N.TCPConnectionHandler
|
|
E.Handler
|
|
}
|
|
|
|
type V2RayClientTransport interface {
|
|
DialContext(ctx context.Context) (net.Conn, error)
|
|
}
|