socks

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: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientHandshake4

func ClientHandshake4(conn io.ReadWriter, command byte, destination M.Socksaddr, username string) (socks4.Response, error)

func ClientHandshake5

func ClientHandshake5(conn io.ReadWriter, command byte, destination M.Socksaddr, username string, password string) (socks5.Response, error)

func HandleConnection

func HandleConnection(ctx context.Context, conn net.Conn, authenticator auth.Authenticator, handler Handler, metadata M.Metadata) error

func HandleConnection0

func HandleConnection0(ctx context.Context, conn net.Conn, version byte, authenticator auth.Authenticator, handler Handler, metadata M.Metadata) error

Types

type AssociatePacketConn

type AssociatePacketConn struct {
	N.NetPacketConn
	// contains filtered or unexported fields
}

func NewAssociateConn

func NewAssociateConn(conn net.Conn, remoteAddr M.Socksaddr, underlying net.Conn) *AssociatePacketConn

func NewAssociatePacketConn

func NewAssociatePacketConn(conn net.PacketConn, remoteAddr M.Socksaddr, underlying net.Conn) *AssociatePacketConn

func (*AssociatePacketConn) Close

func (c *AssociatePacketConn) Close() error

func (*AssociatePacketConn) FrontHeadroom

func (c *AssociatePacketConn) FrontHeadroom() int

func (*AssociatePacketConn) Read

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

func (*AssociatePacketConn) ReadFrom

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

func (*AssociatePacketConn) ReadPacket

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

func (*AssociatePacketConn) RemoteAddr

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

func (*AssociatePacketConn) Upstream

func (c *AssociatePacketConn) Upstream() any

func (*AssociatePacketConn) Write

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

func (*AssociatePacketConn) WritePacket

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

func (*AssociatePacketConn) WriteTo

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

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(dialer N.Dialer, serverAddr M.Socksaddr, version Version, username string, password string) *Client

func NewClientFromURL

func NewClientFromURL(dialer N.Dialer, rawURL string) (*Client, error)

func (*Client) BindContext

func (c *Client) BindContext(ctx context.Context, address M.Socksaddr) (net.Conn, error)

func (*Client) DialContext

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

func (*Client) ListenPacket

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

type Handler

type Handler interface {
	N.TCPConnectionHandler
	N.UDPConnectionHandler
}

type VectorisedAssociatePacketConn

type VectorisedAssociatePacketConn struct {
	AssociatePacketConn
	N.VectorisedPacketWriter
}

func NewVectorisedAssociateConn

func NewVectorisedAssociateConn(conn net.Conn, writer N.VectorisedWriter, remoteAddr M.Socksaddr, underlying net.Conn) *VectorisedAssociatePacketConn

func NewVectorisedAssociatePacketConn

func NewVectorisedAssociatePacketConn(conn net.PacketConn, writer N.VectorisedPacketWriter, remoteAddr M.Socksaddr, underlying net.Conn) *VectorisedAssociatePacketConn

func (*VectorisedAssociatePacketConn) FrontHeadroom

func (c *VectorisedAssociatePacketConn) FrontHeadroom() int

func (*VectorisedAssociatePacketConn) WriteVectorisedPacket

func (v *VectorisedAssociatePacketConn) WriteVectorisedPacket(buffers []*buf.Buffer, destination M.Socksaddr) error

type Version

type Version uint8
const (
	Version4 Version = iota
	Version4A
	Version5
)

func ParseVersion

func ParseVersion(version string) (Version, error)

func (Version) String

func (v Version) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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