Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeRequest(request Request) (*buf.Buffer, error)
- func NewServerConn(packetConn net.PacketConn, version int) net.Conn
- func RequestDestination(version uint8) M.Socksaddr
- func WriteRequest(writer io.Writer, request Request) error
- type Client
- func (c *Client) DialConn(conn net.Conn, isConnect bool, destination M.Socksaddr) (*Conn, error)
- func (c *Client) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)
- func (c *Client) DialEarlyConn(conn net.Conn, isConnect bool, destination M.Socksaddr) (*Conn, error)
- func (c *Client) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)
- type Conn
- func (c *Conn) InitializeReadWaiter(options N.ReadWaitOptions) (needCopy bool)
- func (c *Conn) NeedAdditionalReadDeadline() bool
- func (c *Conn) Read(p []byte) (n int, err error)
- func (c *Conn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
- func (c *Conn) ReadPacket(buffer *buf.Buffer) (destination M.Socksaddr, err error)
- func (c *Conn) Upstream() any
- func (c *Conn) WaitReadPacket() (buffer *buf.Buffer, destination M.Socksaddr, err error)
- func (c *Conn) Write(p []byte) (n int, err error)
- func (c *Conn) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error
- func (c *Conn) WriteTo(p []byte, addr net.Addr) (n int, err error)
- type LazyClientConn
- func (c *LazyClientConn) NeedHandshake() bool
- func (c *LazyClientConn) ReaderReplaceable() bool
- func (c *LazyClientConn) Upstream() any
- func (c *LazyClientConn) Write(p []byte) (n int, err error)
- func (c *LazyClientConn) WriteVectorised(buffers []*buf.Buffer) error
- func (c *LazyClientConn) WriterReplaceable() bool
- type Request
- type ServerConn
Constants ¶
View Source
const ( Version = 2 LegacyVersion = 1 MagicAddress = "sp.v2.udp-over-tcp.arpa" LegacyMagicAddress = "sp.udp-over-tcp.arpa" )
Variables ¶
View Source
var AddrParser = M.NewSerializer( M.AddressFamilyByte(0x00, M.AddressFamilyIPv4), M.AddressFamilyByte(0x01, M.AddressFamilyIPv6), M.AddressFamilyByte(0x02, M.AddressFamilyFqdn), )
Functions ¶
func NewServerConn ¶
func NewServerConn(packetConn net.PacketConn, version int) net.Conn
func RequestDestination ¶ added in v0.2.0
Types ¶
type Client ¶ added in v0.2.0
func (*Client) DialContext ¶ added in v0.2.0
func (*Client) DialEarlyConn ¶ added in v0.2.0
func (*Client) ListenPacket ¶ added in v0.2.0
type Conn ¶ added in v0.2.0
func (*Conn) InitializeReadWaiter ¶ added in v0.3.0
func (c *Conn) InitializeReadWaiter(options N.ReadWaitOptions) (needCopy bool)
func (*Conn) NeedAdditionalReadDeadline ¶ added in v0.2.4
func (*Conn) ReadPacket ¶ added in v0.2.0
func (*Conn) WaitReadPacket ¶ added in v0.3.0
func (*Conn) WritePacket ¶ added in v0.2.0
type LazyClientConn ¶ added in v0.2.0
func NewLazyClientConn ¶ added in v0.2.0
func NewLazyClientConn(conn net.Conn, request Request) *LazyClientConn
func (*LazyClientConn) NeedHandshake ¶ added in v0.2.0
func (c *LazyClientConn) NeedHandshake() bool
func (*LazyClientConn) ReaderReplaceable ¶ added in v0.2.0
func (c *LazyClientConn) ReaderReplaceable() bool
func (*LazyClientConn) Upstream ¶ added in v0.2.0
func (c *LazyClientConn) Upstream() any
func (*LazyClientConn) Write ¶ added in v0.2.0
func (c *LazyClientConn) Write(p []byte) (n int, err error)
func (*LazyClientConn) WriteVectorised ¶ added in v0.2.0
func (c *LazyClientConn) WriteVectorised(buffers []*buf.Buffer) error
func (*LazyClientConn) WriterReplaceable ¶ added in v0.2.0
func (c *LazyClientConn) WriterReplaceable() bool
type ServerConn ¶
type ServerConn struct { net.PacketConn // contains filtered or unexported fields }
func (*ServerConn) Close ¶
func (c *ServerConn) Close() error
func (*ServerConn) RemoteAddr ¶
func (c *ServerConn) RemoteAddr() net.Addr
Click to show internal directories.
Click to hide internal directories.