Documentation ¶
Overview ¶
nt contains some network related type and helper function
Index ¶
- func GuessDefaultIPv4() net.IP
- func GuessDefaultIPv6() net.IP
- func ParseSrcDstAddrFromIPHeader(header []byte, version int) (*message.SocksAddr, *message.SocksAddr, int, error)
- func UdpPortAvaliable(a net.Addr) bool
- type BufferPrefixedConn
- type BufferPrefixedReader
- type Datagram
- type DualModeMultiplexedConn
- type MultiplexedConn
- type NetBufferOnlyReader
- type SeqPacket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GuessDefaultIPv4 ¶
func GuessDefaultIPv6 ¶
func UdpPortAvaliable ¶
Types ¶
type BufferPrefixedConn ¶
type BufferPrefixedConn struct { BufferPrefixedReader // contains filtered or unexported fields }
BufferPrefixedConn is a net.Conn with BufferPrefixedReader
func NewBufferPrefixedConn ¶
func NewBufferPrefixedConn(c net.Conn, b []byte) *BufferPrefixedConn
type BufferPrefixedReader ¶
type BufferPrefixedReader struct { Reader io.Reader Buffer []byte // contains filtered or unexported fields }
BufferPrefixedReader is an io.Reader which first read from Buffer, then from another io.Reader
func NewBufferPrefixedReader ¶
func NewBufferPrefixedReader(r io.Reader, b []byte) *BufferPrefixedReader
type Datagram ¶
type Datagram interface { Data() []byte Reply(b []byte) error // contains filtered or unexported methods }
func ReadUDPDatagram ¶
func ReadUDPDatagram(pc net.PacketConn) (Datagram, error)
type DualModeMultiplexedConn ¶
type DualModeMultiplexedConn interface { MultiplexedConn SeqPacket }
func WrapQUICConn ¶
func WrapQUICConn(conn quic.Connection) DualModeMultiplexedConn
type MultiplexedConn ¶
type NetBufferOnlyReader ¶
NetBufferOnlyReader is a wrapper over net.Conn which try to only read data which already in OS buffer by setting read timeout to 1us
Click to show internal directories.
Click to hide internal directories.