Documentation
¶
Index ¶
Constants ¶
View Source
const ( NoAuth = uint8(0) UserPassAuth = uint8(2) )
View Source
const ( ConnectCommand = uint8(1) BindCommand = uint8(2) AssociateCommand = uint8(3) )
View Source
const (
Socks5Version = uint8(5)
)
Variables ¶
View Source
var ( UserAuthFailed = fmt.Errorf("user authentication failed") NoSupportedAuth = fmt.Errorf("no supported authentication mechanism") )
Functions ¶
This section is empty.
Types ¶
type AddressRewriter ¶
type AuthContext ¶
type Authenticator ¶
type Config ¶
type Config struct {
AuthMethods []Authenticator
Credentials CredentialStore
Resolver NameResolver
Rules RuleSet
Rewriter AddressRewriter
BindIP net.IP
Dial func(ctx context.Context, network, addr string) (net.Conn, error)
}
type CredentialStore ¶
type DNSResolver ¶
type DNSResolver struct{}
type NameResolver ¶
type NoAuthAuthenticator ¶
type NoAuthAuthenticator struct{}
func (NoAuthAuthenticator) Authenticate ¶
func (a NoAuthAuthenticator) Authenticate(_ io.Reader, writer io.Writer) (*AuthContext, error)
func (NoAuthAuthenticator) GetCode ¶
func (a NoAuthAuthenticator) GetCode() uint8
type PermitCommand ¶
type Request ¶
type Request struct {
Version uint8
Command uint8
AuthContext *AuthContext
RemoteAddr *AddrSpec
DestAddr *AddrSpec
// contains filtered or unexported fields
}
type RuleSet ¶
func PermitNone ¶
func PermitNone() RuleSet
type StaticCredentials ¶
func (StaticCredentials) Valid ¶
func (s StaticCredentials) Valid(user, password string) bool
type UserPassAuthenticator ¶
type UserPassAuthenticator struct {
Credentials CredentialStore
}
func (UserPassAuthenticator) Authenticate ¶
func (a UserPassAuthenticator) Authenticate(reader io.Reader, writer io.Writer) (*AuthContext, error)
func (UserPassAuthenticator) GetCode ¶
func (a UserPassAuthenticator) GetCode() uint8
Click to show internal directories.
Click to hide internal directories.