1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-17 18:06:15 -05:00
v2fly/app/tun/net/net.go
2023-10-22 22:44:34 +01:00

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())
}