mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-14 16:25:57 -05:00
26 lines
399 B
Go
26 lines
399 B
Go
package net
|
|
|
|
import (
|
|
"github.com/v2fly/v2ray-core/v5/common/net"
|
|
|
|
"gvisor.dev/gvisor/pkg/tcpip"
|
|
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
|
)
|
|
|
|
type TCPConn interface {
|
|
net.Conn
|
|
|
|
ID() *stack.TransportEndpointID
|
|
}
|
|
|
|
type UDPConn interface {
|
|
net.Conn
|
|
net.PacketConn
|
|
|
|
ID() *stack.TransportEndpointID
|
|
}
|
|
|
|
func AddressFromTCPIPAddr(addr tcpip.Address) net.Address {
|
|
return net.IPAddress(addr.AsSlice())
|
|
}
|