update config
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/go-gost/gost/pkg/auth"
|
||||
"github.com/go-gost/gost/pkg/bypass"
|
||||
"github.com/go-gost/gost/pkg/chain"
|
||||
"github.com/go-gost/gost/pkg/handler"
|
||||
@ -20,11 +21,12 @@ func init() {
|
||||
}
|
||||
|
||||
type relayHandler struct {
|
||||
group *chain.NodeGroup
|
||||
bypass bypass.Bypass
|
||||
router *chain.Router
|
||||
logger logger.Logger
|
||||
md metadata
|
||||
group *chain.NodeGroup
|
||||
bypass bypass.Bypass
|
||||
router *chain.Router
|
||||
authenticator auth.Authenticator
|
||||
logger logger.Logger
|
||||
md metadata
|
||||
}
|
||||
|
||||
func NewHandler(opts ...handler.Option) handler.Handler {
|
||||
@ -107,7 +109,7 @@ func (h *relayHandler) Handle(ctx context.Context, conn net.Conn) {
|
||||
Version: relay.Version1,
|
||||
Status: relay.StatusOK,
|
||||
}
|
||||
if h.md.authenticator != nil && !h.md.authenticator.Authenticate(user, pass) {
|
||||
if h.authenticator != nil && !h.authenticator.Authenticate(user, pass) {
|
||||
resp.Status = relay.StatusUnauthorized
|
||||
resp.WriteTo(conn)
|
||||
h.logger.Error("unauthorized")
|
||||
|
Reference in New Issue
Block a user