Documentation
¶
Index ¶
Constants ¶
View Source
const ( IPv4 byte = 0x01 DomainName byte = 0x03 IPv6 byte = 0x04 )
View Source
const (
SocksVersion byte = 0x05
)
Variables ¶
Functions ¶
func DenyRuleset ¶
func DenyRuleset(_ CommandType, _ net.IP, _ uint16) bool
func EmptyRuleset ¶
func EmptyRuleset(_ CommandType, _ net.IP, _ uint16) bool
func NoAuth ¶
func NoAuth(_ *bufio.ReadWriter) error
Types ¶
type AuthProvider ¶
type AuthProvider func(*bufio.ReadWriter) error
func UserPass ¶
func UserPass(user, pass string) AuthProvider
type CommandReply ¶
type CommandReply byte
const ( Succeeded CommandReply = 0x00 ServerFailure CommandReply = 0x01 ConnForbidden CommandReply = 0x02 NetUnreachable CommandReply = 0x03 HostUnreachable CommandReply = 0x04 ConnRefused CommandReply = 0x05 TTLExpired CommandReply = 0x06 CommandNotSupported CommandReply = 0x07 AddrTypeNotSupported CommandReply = 0x08 )
type CommandType ¶
type CommandType byte
const ( Connect CommandType = 0x01 Bind CommandType = 0x02 UdpAssociate CommandType = 0x03 )
type RulesetValidator ¶
type RulesetValidator func(CommandType, net.IP, uint16) bool
type Server ¶
type Server struct { AuthProviders map[byte]AuthProvider Ruleset RulesetValidator // contains filtered or unexported fields }
func CreateServer ¶
func CreateServer() *Server
func (*Server) CloseClients ¶
Click to show internal directories.
Click to hide internal directories.