socks

package module
v0.0.0-...-c105259 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2018 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Commands = []string{"CONNECT", "BIND", "UDP ASSOCIATE"}
)

Functions

This section is empty.

Types

type AuthContext

type AuthContext struct {
	Method  int
	Payload map[string]string
}

type Config

type Config struct {
	// Func to valid username/password pair
	ValidAuth func(username, password string) bool
	// Connections per user limit
	ConnsPerUser int
	// Verbose logs
	Verbose bool
}

type Server

type Server struct {
	Conns     []net.Conn
	UserConns sync.Map
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config *Config) *Server

func (*Server) ListenAndServe

func (srv *Server) ListenAndServe(network, addr string) error

ListenAndServe is used to create a listener and serve on it

func (*Server) Serve

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

Serve is used to serve connections from a listener

Jump to

Keyboard shortcuts

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