uot

package
v0.0.0-...-775528f Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: GPL-2.0 Imports: 10 Imported by: 0

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

func EncodeRequest(request Request) *buf.Buffer

func NewServerConn

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

func RequestDestination

func RequestDestination(version uint8) M.Socksaddr

func WriteRequest

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

Types

type Client

type Client struct {
	Dialer  N.Dialer
	Version uint8
}

func (*Client) DialConn

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

func (*Client) DialContext

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

func (*Client) DialEarlyConn

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

func (*Client) ListenPacket

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

type Conn

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

func NewConn

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

func NewLazyConn

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

func (*Conn) NeedAdditionalReadDeadline

func (c *Conn) NeedAdditionalReadDeadline() bool

func (*Conn) Read

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

func (*Conn) ReadFrom

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

func (*Conn) ReadPacket

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

func (*Conn) Upstream

func (c *Conn) Upstream() any

func (*Conn) Write

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

func (*Conn) WritePacket

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

func (*Conn) WriteTo

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

type LazyClientConn

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

func NewLazyClientConn

func NewLazyClientConn(conn net.Conn, request Request) *LazyClientConn

func (*LazyClientConn) NeedHandshake

func (c *LazyClientConn) NeedHandshake() bool

func (*LazyClientConn) ReaderReplaceable

func (c *LazyClientConn) ReaderReplaceable() bool

func (*LazyClientConn) Upstream

func (c *LazyClientConn) Upstream() any

func (*LazyClientConn) Write

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

func (*LazyClientConn) WriteVectorised

func (c *LazyClientConn) WriteVectorised(buffers []*buf.Buffer) error

func (*LazyClientConn) WriterReplaceable

func (c *LazyClientConn) WriterReplaceable() bool

type Request

type Request struct {
	IsConnect   bool
	Destination M.Socksaddr
}

func ReadRequest

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