Documentation ¶
Index ¶
- func ConvertICMPError(msg *icmp.Message, ip *net.IPAddr, ver int) (message.UDPErrorType, netip.Addr, []byte)
- func DialWithOption(ctx context.Context, addr message.SocksAddr, opt message.StackOptionInfo) (net.Conn, message.StackOptionInfo, error)
- func Drain(c io.Reader) error
- func GuessDefaultIPv4() net.IP
- func GuessDefaultIPv6() net.IP
- func ListenPacketWithOption(ctx context.Context, addr message.SocksAddr, option message.StackOptionInfo) (net.PacketConn, message.StackOptionInfo, error)
- func ListenerWithOption(ctx context.Context, addr message.SocksAddr, opt message.StackOptionInfo) (net.Listener, message.StackOptionInfo, error)
- func OnReadError(c io.Reader, f func(error))
- func ParseSrcDstAddrFromIPHeader(header []byte, version int) (src, dst netip.AddrPort, proto int, e error)
- func Relay(ctx context.Context, c, r net.Conn, timeout time.Duration) error
- func SetConnOption(conn net.Conn, opt message.StackOptionInfo) message.StackOptionInfo
- func SetPacketConnOption(conn net.PacketConn, opt message.StackOptionInfo) message.StackOptionInfo
- func UDPPortAvaliable(a netip.AddrPort) bool
- type BufferPrefixedConn
- type BufferPrefixedReader
- type Datagram
- type DualModeMultiplexedConn
- type InternetOutbound
- func (i InternetOutbound) Dial(ctx context.Context, addr message.SocksAddr, option message.StackOptionInfo) (net.Conn, message.StackOptionInfo, error)
- func (i InternetOutbound) Listen(ctx context.Context, addr message.SocksAddr, option message.StackOptionInfo) (net.Listener, message.StackOptionInfo, error)
- func (i InternetOutbound) ListenPacket(ctx context.Context, addr message.SocksAddr, option message.StackOptionInfo) (net.PacketConn, message.StackOptionInfo, error)
- func (i InternetOutbound) SetConnOption(conn net.Conn, opt message.StackOptionInfo) message.StackOptionInfo
- func (i InternetOutbound) SetPacketConnOption(conn net.PacketConn, opt message.StackOptionInfo) message.StackOptionInfo
- type MultiplexedConn
- type NetBufferOnlyReader
- type Outbound
- type SeqPacket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertICMPError ¶
func DialWithOption ¶
func GuessDefaultIPv4 ¶
func GuessDefaultIPv6 ¶
func ListenPacketWithOption ¶
func ListenPacketWithOption(ctx context.Context, addr message.SocksAddr, option message.StackOptionInfo) (net.PacketConn, message.StackOptionInfo, error)
func ListenerWithOption ¶
func OnReadError ¶
func SetConnOption ¶
func SetConnOption(conn net.Conn, opt message.StackOptionInfo) message.StackOptionInfo
func SetPacketConnOption ¶
func SetPacketConnOption(conn net.PacketConn, opt message.StackOptionInfo) message.StackOptionInfo
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 ReadPacketDatagram ¶
func ReadPacketDatagram(pc net.PacketConn) (Datagram, error)
type DualModeMultiplexedConn ¶
type DualModeMultiplexedConn interface { MultiplexedConn SeqPacket }
func WrapQUICConn ¶
func WrapQUICConn(conn quic.Connection) DualModeMultiplexedConn
type InternetOutbound ¶
type InternetOutbound struct{}
InternetOutbound implements ServerOutbound, create a internet connection/listener.
func (InternetOutbound) Dial ¶
func (i InternetOutbound) Dial(ctx context.Context, addr message.SocksAddr, option message.StackOptionInfo) (net.Conn, message.StackOptionInfo, error)
func (InternetOutbound) Listen ¶
func (i InternetOutbound) Listen(ctx context.Context, addr message.SocksAddr, option message.StackOptionInfo) (net.Listener, message.StackOptionInfo, error)
func (InternetOutbound) ListenPacket ¶
func (i InternetOutbound) ListenPacket(ctx context.Context, addr message.SocksAddr, option message.StackOptionInfo) (net.PacketConn, message.StackOptionInfo, error)
func (InternetOutbound) SetConnOption ¶
func (i InternetOutbound) SetConnOption(conn net.Conn, opt message.StackOptionInfo) message.StackOptionInfo
func (InternetOutbound) SetPacketConnOption ¶
func (i InternetOutbound) SetPacketConnOption(conn net.PacketConn, opt message.StackOptionInfo) message.StackOptionInfo
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.
type Outbound ¶
type Outbound interface { Dial(ctx context.Context, addr message.SocksAddr, option message.StackOptionInfo) (net.Conn, message.StackOptionInfo, error) Listen(ctx context.Context, addr message.SocksAddr, option message.StackOptionInfo) (net.Listener, message.StackOptionInfo, error) ListenPacket(ctx context.Context, addr message.SocksAddr, option message.StackOptionInfo) (net.PacketConn, message.StackOptionInfo, error) SetConnOption(conn net.Conn, opt message.StackOptionInfo) message.StackOptionInfo SetPacketConnOption(conn net.PacketConn, opt message.StackOptionInfo) message.StackOptionInfo }
Outbound is a group of function called by ServerWorker when a connection or listener is needed to fulfill client request.
Click to show internal directories.
Click to hide internal directories.