mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-06 01:07:03 +08:00
25 lines
436 B
Go
25 lines
436 B
Go
package adapter
|
|
|
|
import (
|
|
"net"
|
|
|
|
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
|
)
|
|
|
|
// TCPConn implements the net.Conn interface.
|
|
type TCPConn interface {
|
|
net.Conn
|
|
|
|
// ID returns the transport endpoint id of TCPConn.
|
|
ID() *stack.TransportEndpointID
|
|
}
|
|
|
|
// UDPConn implements net.Conn and net.PacketConn.
|
|
type UDPConn interface {
|
|
net.Conn
|
|
net.PacketConn
|
|
|
|
// ID returns the transport endpoint id of UDPConn.
|
|
ID() *stack.TransportEndpointID
|
|
}
|