Files
phishingclub/backend/vendor/github.com/wzshiming/socks5/auth.go
T
Ronni Skansing 07c8adaf76 update vendor deps
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
2025-11-06 23:31:08 +01:00

22 lines
630 B
Go

package socks5
// AuthenticationFunc Authentication interface is implemented
type AuthenticationFunc func(cmd Command, username, password string) bool
// Auth authentication processing
func (f AuthenticationFunc) Auth(cmd Command, username, password string) bool {
return f(cmd, username, password)
}
// Authentication proxy authentication
type Authentication interface {
Auth(cmd Command, username, password string) bool
}
// UserAuth basic authentication
func UserAuth(username, password string) Authentication {
return AuthenticationFunc(func(c Command, u, p string) bool {
return username == u && password == p
})
}