mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-10 06:16:53 -05:00
25 lines
383 B
Go
25 lines
383 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
|
|
|
|
ID() *stack.TransportEndpointID
|
|
}
|
|
|
|
func AddressFromTCPIPAddr(addr tcpip.Address) net.Address {
|
|
return net.IPAddress(addr.AsSlice())
|
|
}
|