socks5

package module
v0.0.0-...-795a9cc Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: GPL-3.0 Imports: 10 Imported by: 1

README

socks5

This is a library for SOCKS5 servers (and clients). RFC1928 and RFC1929 are supported.

Documentation

Index

Constants

View Source
const (
	AddrIPv4       = 0x01
	AddrDomainName = 0x03
	AddrIPv6       = 0x04
)
View Source
const (
	AuthNoAuthRequired      = 0x00
	AuthGSSAPI              = 0x01
	AuthUsernamePassword    = 0x02
	AuthNoAcceptableMethods = 0xff
)
View Source
const (
	CmdConnect      = 0x01
	CmdBind         = 0x02
	CmdUDPAssociate = 0x03
)
View Source
const (
	RepSucceeded                 = 0x00
	RepGeneralSOCKSServerFailure = 0x01
	RepConnectionNotAllowed      = 0x02
	RepNetworkUnreachable        = 0x03
	RepHostUnreachable           = 0x04
	RepConnectionRefused         = 0x05
	RepTTLExpired                = 0x06
	RepCommandNotSupported       = 0x07
	RepAddressTypeNotSupported   = 0x08
)
View Source
const SocksVersion = 0x05

Variables

View Source
var (
	ErrNoAcceptableMethods = errors.New("no acceptable athentication method")
	ErrInvalidAddrType     = errors.New("invalid address type")
	ErrUnsupportedVersion  = errors.New("unsupported SOCKS protocol version")
)

Functions

This section is empty.

Types

type MethodSelection

type MethodSelection struct {
	VER    byte
	METHOD byte
}

type Reply

type Reply struct {
	VER     byte
	REP     byte
	RSV     byte
	ATYP    byte
	BNDAddr []byte
	BNDPort uint16
}

type Request

type Request struct {
	VER     byte
	CMD     byte
	RSV     byte
	ATYP    byte
	DSTAddr []byte
	DSTPort uint16
}

type Server

type Server struct {
	Listen   string
	Logger   *penlog.Logger
	Auth     int
	Username string
	Password string
}

func (*Server) Serve

func (s *Server) Serve() error

func (*Server) ServeFrom

func (s *Server) ServeFrom(conn io.ReadWriteCloser) error

type UsernamePasswordRequest

type UsernamePasswordRequest struct {
	VER    byte // This is always 1
	ULEN   byte
	UNAME  []byte
	PLEN   byte
	PASSWD []byte
}

RFC1929 types

type UsernamePasswordResponse

type UsernamePasswordResponse struct {
	VER    byte // This is always 1
	STATUS byte
}

type VersionIdentifier

type VersionIdentifier struct {
	VER      byte
	NMETHODS byte
	METHODS  []byte
}

RFC1928 types

Jump to

Keyboard shortcuts

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