socks5

package
v0.0.0-...-e5d0cd3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Version = 5

Version is socks5 version number.

Variables

This section is empty.

Functions

func NewSocks5Dialer

func NewSocks5Dialer(s string, d netproxy.Dialer) (netproxy.Dialer, error)

NewSocks5Dialer returns a socks5 proxy netproxy.

Types

type PktConn

type PktConn struct {
	netproxy.PacketConn
	// contains filtered or unexported fields
}

PktConn .

func NewPktConn

func NewPktConn(c netproxy.PacketConn, proxyAddr string, targetAddr string, ctrlConn netproxy.Conn) *PktConn

NewPktConn returns a PktConn, the writeAddr must be *net.UDPAddr or *net.UnixAddr.

func (*PktConn) Close

func (pc *PktConn) Close() error

Close .

func (*PktConn) Read

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

func (*PktConn) ReadFrom

func (pc *PktConn) ReadFrom(b []byte) (int, netip.AddrPort, error)

ReadFrom overrides the original function from transport.PacketConn.

func (*PktConn) Write

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

func (*PktConn) WriteTo

func (pc *PktConn) WriteTo(b []byte, addr string) (int, error)

WriteTo overrides the original function from transport.PacketConn.

type Socks5

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

Socks5 is a base socks5 struct.

func NewSocks5

func NewSocks5(s string, d netproxy.Dialer) (*Socks5, error)

NewSocks5 returns a Proxy that makes SOCKS v5 connections to the given address. with an optional username and password. (RFC 1928)

func (*Socks5) Dial

func (s *Socks5) Dial(network, addr string) (netproxy.Conn, error)

Jump to

Keyboard shortcuts

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