server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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