socks5

package
v0.0.0-...-41fa4f3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Connect cmd = iota + 1
	Bind
	Udp
)
View Source
const (
	IPv4 atyp = iota + 1

	Domain
	IPv6
)
View Source
const (
	Succeeded rep = iota
	GeneralSocks5ServerFailure
	ConnectionNotAllowedByRuleset
	NetworkUnreachable
	HostUnreachable
	ConnectionRefused
	TTLExpired
	CommandNotSupported
	AddressTypeNotSupported
)

Variables

View Source
var ErrUnsupportedVersion = errors.New("unsupported version")

Functions

func Client

func Client(conn net.Conn, dstAddr string) (net.Conn, error)

func ListenAndServe

func ListenAndServe(addr string) error

Types

type Request

type Request []byte

func NewRequest

func NewRequest(c cmd, a atyp, addr string) (Request, error)

func ReadRequest

func ReadRequest(r io.Reader) (Request, error)

func (Request) Addr

func (r Request) Addr() string

func (Request) AddrType

func (r Request) AddrType() atyp

type Respone

type Respone []byte

func NewRespone

func NewRespone(r rep, a atyp, addr string) (Respone, error)

func ReadRespone

func ReadRespone(r io.Reader) (Respone, error)

func (Respone) Addr

func (r Respone) Addr() string

func (Respone) AddrType

func (r Respone) AddrType() atyp

type Server

type Server struct {
	Addr string
}

func (*Server) ListenAndServe

func (srv *Server) ListenAndServe() error

func (*Server) Serve

func (srv *Server) Serve(l net.Listener) error

Jump to

Keyboard shortcuts

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