add HTTP plugin
This commit is contained in:
@ -92,7 +92,7 @@ func (h *socks4Handler) Handle(ctx context.Context, conn net.Conn, opts ...handl
|
||||
conn.SetReadDeadline(time.Time{})
|
||||
|
||||
if h.options.Auther != nil {
|
||||
ok, id := h.options.Auther.Authenticate(ctx, string(req.Userid), "")
|
||||
id, ok := h.options.Auther.Authenticate(ctx, string(req.Userid), "")
|
||||
if !ok {
|
||||
resp := gosocks4.NewReply(gosocks4.RejectedUserid, nil)
|
||||
log.Trace(resp)
|
||||
|
@ -68,7 +68,7 @@ func (s *serverSelector) OnSelected(method uint8, conn net.Conn) (string, net.Co
|
||||
var id string
|
||||
if s.Authenticator != nil {
|
||||
var ok bool
|
||||
ok, id = s.Authenticator.Authenticate(context.Background(), req.Username, req.Password)
|
||||
id, ok = s.Authenticator.Authenticate(context.Background(), req.Username, req.Password)
|
||||
if !ok {
|
||||
resp := gosocks5.NewUserPassResponse(gosocks5.UserPassVer, gosocks5.Failure)
|
||||
if err := resp.Write(conn); err != nil {
|
||||
|
Reference in New Issue
Block a user