uot

package
v0.4.0-beta.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2024 License: GPL-2.0 Imports: 10 Imported by: 112

Documentation

Index

Constants

View Source
const (
	Version            = 2
	LegacyVersion      = 1
	MagicAddress       = "sp.v2.udp-over-tcp.arpa"
	LegacyMagicAddress = "sp.udp-over-tcp.arpa"
)

Variables

Functions

func EncodeRequest added in v0.2.0

func EncodeRequest(request Request) (*buf.Buffer, error)

func NewServerConn

func NewServerConn(packetConn net.PacketConn, version int) net.Conn

func RequestDestination added in v0.2.0

func RequestDestination(version uint8) M.Socksaddr

func WriteRequest added in v0.2.0

func WriteRequest(writer io.Writer, request Request) error

Types

type Client added in v0.2.0

type Client struct {
	Dialer  N.Dialer
	Version uint8
}

func (*Client) DialConn added in v0.2.0

func (c *Client) DialConn(conn net.Conn, isConnect bool, destination M.Socksaddr) (*Conn, error)

func (*Client) DialContext added in v0.2.0

func (c *Client) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Client) DialEarlyConn added in v0.2.0

func (c *Client) DialEarlyConn(conn net.Conn, isConnect bool, destination M.Socksaddr) (*Conn, error)

func (*Client) ListenPacket added in v0.2.0

func (c *Client) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

type Conn added in v0.2.0

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

func NewConn added in v0.2.0

func NewConn(conn net.Conn, request Request) *Conn

func NewLazyConn added in v0.2.0

func NewLazyConn(conn net.Conn, request Request) *Conn

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 (c *Conn) NeedAdditionalReadDeadline() bool

func (*Conn) Read added in v0.2.0

func (c *Conn) Read(p []byte) (n int, err error)

func (*Conn) ReadFrom added in v0.2.0

func (c *Conn) ReadFrom(p []byte) (n int, addr net.Addr, err error)

func (*Conn) ReadPacket added in v0.2.0

func (c *Conn) ReadPacket(buffer *buf.Buffer) (destination M.Socksaddr, err error)

func (*Conn) Upstream added in v0.2.0

func (c *Conn) Upstream() any

func (*Conn) WaitReadPacket added in v0.3.0

func (c *Conn) WaitReadPacket() (buffer *buf.Buffer, destination M.Socksaddr, err error)

func (*Conn) Write added in v0.2.0

func (c *Conn) Write(p []byte) (n int, err error)

func (*Conn) WritePacket added in v0.2.0

func (c *Conn) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error

func (*Conn) WriteTo added in v0.2.0

func (c *Conn) WriteTo(p []byte, addr net.Addr) (n int, err error)

type LazyClientConn added in v0.2.0

type LazyClientConn struct {
	net.Conn
	// contains filtered or unexported fields
}

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 Request added in v0.2.0

type Request struct {
	IsConnect   bool
	Destination M.Socksaddr
}

func ReadRequest added in v0.2.0

func ReadRequest(reader io.Reader) (*Request, error)

type ServerConn

type ServerConn struct {
	net.PacketConn
	// contains filtered or unexported fields
}

func (*ServerConn) Close

func (c *ServerConn) Close() error

func (*ServerConn) Read

func (c *ServerConn) Read(b []byte) (n int, err error)

func (*ServerConn) RemoteAddr

func (c *ServerConn) RemoteAddr() net.Addr

func (*ServerConn) Write

func (c *ServerConn) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL