diff --git a/chain/node.go b/chain/node.go index 4bea0e3..ab216a0 100644 --- a/chain/node.go +++ b/chain/node.go @@ -8,6 +8,16 @@ import ( "github.com/go-gost/core/selector" ) +type HTTPNodeSettings struct { + Host string + Header map[string]string +} + +type TLSNodeSettings struct { + ServerName string + Secure bool +} + type NodeOptions struct { Transport *Transport Bypass bypass.Bypass @@ -16,6 +26,8 @@ type NodeOptions struct { Metadata metadata.Metadata Host string Protocol string + HTTP *HTTPNodeSettings + TLS *TLSNodeSettings } type NodeOption func(*NodeOptions) @@ -62,6 +74,18 @@ func MetadataNodeOption(md metadata.Metadata) NodeOption { } } +func HTTPNodeOption(httpSettings *HTTPNodeSettings) NodeOption { + return func(o *NodeOptions) { + o.HTTP = httpSettings + } +} + +func TLSNodeOption(tlsSettings *TLSNodeSettings) NodeOption { + return func(o *NodeOptions) { + o.TLS = tlsSettings + } +} + type Node struct { Name string Addr string