From ff3b77ac2899d4403e3a1e697c0a95fac7cbda75 Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Tue, 31 Jan 2023 13:37:58 +0800 Subject: [PATCH] add auther option for node --- chain/node.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chain/node.go b/chain/node.go index ab216a0..fa4c84b 100644 --- a/chain/node.go +++ b/chain/node.go @@ -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