2022-08-22 18:53:47 +08:00
|
|
|
package adapter
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"net"
|
2023-02-13 05:53:03 +08:00
|
|
|
|
|
|
|
N "github.com/sagernet/sing/common/network"
|
2022-08-22 18:53:47 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
type V2RayServerTransport interface {
|
2022-08-22 21:20:05 +08:00
|
|
|
Network() []string
|
2022-08-22 18:53:47 +08:00
|
|
|
Serve(listener net.Listener) error
|
2022-08-22 21:20:05 +08:00
|
|
|
ServePacket(listener net.PacketConn) error
|
2022-08-22 18:53:47 +08:00
|
|
|
Close() error
|
|
|
|
}
|
|
|
|
|
2023-02-13 05:53:03 +08:00
|
|
|
type V2RayServerTransportHandler interface {
|
2024-10-21 23:38:34 +08:00
|
|
|
N.TCPConnectionHandlerEx
|
2023-02-13 05:53:03 +08:00
|
|
|
}
|
|
|
|
|
2022-08-22 18:53:47 +08:00
|
|
|
type V2RayClientTransport interface {
|
|
|
|
DialContext(ctx context.Context) (net.Conn, error)
|
2024-07-07 15:45:50 +08:00
|
|
|
Close() error
|
2022-08-22 18:53:47 +08:00
|
|
|
}
|