add auth support for forwarder node

This commit is contained in:
ginuerzh
2023-01-31 14:04:28 +08:00
parent 3e35a7b761
commit ebdb77d71f
8 changed files with 75 additions and 25 deletions

View File

@ -11,6 +11,7 @@ import (
"github.com/go-gost/core/auth"
"github.com/go-gost/core/logger"
"github.com/go-gost/x/internal/loader"
xlogger "github.com/go-gost/x/logger"
)
type options struct {
@ -74,6 +75,9 @@ func NewAuthenticator(opts ...Option) auth.Authenticator {
for _, opt := range opts {
opt(&options)
}
if options.logger == nil {
options.logger = xlogger.Nop()
}
ctx, cancel := context.WithCancel(context.TODO())
p := &authenticator{