add auther option for node

This commit is contained in:
ginuerzh
2023-01-31 13:37:58 +08:00
parent 1a643651c0
commit ff3b77ac28

View File

@ -1,6 +1,7 @@
package chain
import (
"github.com/go-gost/core/auth"
"github.com/go-gost/core/bypass"
"github.com/go-gost/core/hosts"
"github.com/go-gost/core/metadata"
@ -28,6 +29,7 @@ type NodeOptions struct {
Protocol string
HTTP *HTTPNodeSettings
TLS *TLSNodeSettings
Auther auth.Authenticator
}
type NodeOption func(*NodeOptions)
@ -86,6 +88,12 @@ func TLSNodeOption(tlsSettings *TLSNodeSettings) NodeOption {
}
}
func AutherNodeOption(auther auth.Authenticator) NodeOption {
return func(o *NodeOptions) {
o.Auther = auther
}
}
type Node struct {
Name string
Addr string