server

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultSelector is the default server selector.
	// It only supports No-Auth Method.
	DefaultSelector gosocks5.Selector = &serverSelector{}
)

Functions

func NewServerSelector

func NewServerSelector(users []*url.Userinfo, methods ...uint8) gosocks5.Selector

Types

type Handler

type Handler interface {
	Handle(conn net.Conn) error
}

Handler is interface for server handler.

var (
	// DefaultHandler is the default server handler.
	DefaultHandler Handler
)

type Server

type Server struct {
	Listener net.Listener
}

Server is a SOCKS5 server.

func (*Server) Addr

func (s *Server) Addr() net.Addr

Addr returns the address of the server

func (*Server) Close

func (s *Server) Close() error

Close closes the socks5 server

func (*Server) Serve

func (s *Server) Serve(h Handler, options ...ServerOption) error

Serve serves incoming requests.

type ServerOption

type ServerOption func(opts *ServerOptions)

ServerOption allows a common way to set server options.

type ServerOptions

type ServerOptions struct {
}

ServerOptions is options for server.

Jump to

Keyboard shortcuts

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