add auther option for node
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
package chain
|
package chain
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/go-gost/core/auth"
|
||||||
"github.com/go-gost/core/bypass"
|
"github.com/go-gost/core/bypass"
|
||||||
"github.com/go-gost/core/hosts"
|
"github.com/go-gost/core/hosts"
|
||||||
"github.com/go-gost/core/metadata"
|
"github.com/go-gost/core/metadata"
|
||||||
@ -28,6 +29,7 @@ type NodeOptions struct {
|
|||||||
Protocol string
|
Protocol string
|
||||||
HTTP *HTTPNodeSettings
|
HTTP *HTTPNodeSettings
|
||||||
TLS *TLSNodeSettings
|
TLS *TLSNodeSettings
|
||||||
|
Auther auth.Authenticator
|
||||||
}
|
}
|
||||||
|
|
||||||
type NodeOption func(*NodeOptions)
|
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 {
|
type Node struct {
|
||||||
Name string
|
Name string
|
||||||
Addr string
|
Addr string
|
||||||
|
Reference in New Issue
Block a user