update config
This commit is contained in:
@ -16,6 +16,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/asaskevich/govalidator"
|
||||
"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"
|
||||
@ -29,10 +30,11 @@ func init() {
|
||||
}
|
||||
|
||||
type httpHandler struct {
|
||||
bypass bypass.Bypass
|
||||
router *chain.Router
|
||||
logger logger.Logger
|
||||
md metadata
|
||||
bypass bypass.Bypass
|
||||
router *chain.Router
|
||||
authenticator auth.Authenticator
|
||||
logger logger.Logger
|
||||
md metadata
|
||||
}
|
||||
|
||||
func NewHandler(opts ...handler.Option) handler.Handler {
|
||||
@ -260,7 +262,7 @@ func (h *httpHandler) basicProxyAuth(proxyAuth string) (username, password strin
|
||||
|
||||
func (h *httpHandler) authenticate(conn net.Conn, req *http.Request, resp *http.Response) (ok bool) {
|
||||
u, p, _ := h.basicProxyAuth(req.Header.Get("Proxy-Authorization"))
|
||||
if h.md.authenticator == nil || h.md.authenticator.Authenticate(u, p) {
|
||||
if h.authenticator == nil || h.authenticator.Authenticate(u, p) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user