server

package
v0.0.0-...-bb6d4ad Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCommandNotSupported = errors.New("command not supported")
View Source
var ErrServerClosed = errors.New("socks5: Server closed")

Functions

This section is empty.

Types

type Config

type Config struct {
	AuthMethods map[auth.Method]auth.Authenticator

	// Optional.
	DialContext  func(ctx context.Context, network, address string) (net.Conn, error)
	Listen       func(ctx context.Context, network, address string) (net.Listener, error)
	ListenPacket func(ctx context.Context, network, address string) (net.PacketConn, error)
}

type NotRequired

type NotRequired struct{}

func (*NotRequired) Authenticate

func (n *NotRequired) Authenticate(conn io.ReadWriter) error

type Request

type Request struct {
	Version  int
	Command  socks5.Command
	DestAddr *address.Info

	DialContext func(ctx context.Context, network, address string) (net.Conn, error)
	Listen      func(ctx context.Context, network, address string) (net.Listener, error)
	// contains filtered or unexported fields
}

type Socks5

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

func New

func New(c *Config) *Socks5

func (*Socks5) ListenAndServe

func (s *Socks5) ListenAndServe(network, addr string) error

ListenAndServe is used to create a listener and serve on it

func (*Socks5) Serve

func (s *Socks5) Serve(l net.Listener) error

Serve is used to serve connections from a listener

func (*Socks5) Shutdown

func (s *Socks5) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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