From a06608ccafbf0b476927d4582c4a9b8c71044a7a Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Wed, 31 Jan 2024 23:17:24 +0800 Subject: [PATCH] added http url rewrite setting for forwarder node --- chain/node.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/chain/node.go b/chain/node.go index 4f66e94..77c0923 100644 --- a/chain/node.go +++ b/chain/node.go @@ -1,6 +1,8 @@ package chain import ( + "regexp" + "github.com/go-gost/core/auth" "github.com/go-gost/core/bypass" "github.com/go-gost/core/hosts" @@ -9,10 +11,16 @@ import ( "github.com/go-gost/core/selector" ) +type HTTPURLRewriteSetting struct { + Pattern *regexp.Regexp + Replacement string +} + type HTTPNodeSettings struct { - Host string - Header map[string]string - Auther auth.Authenticator + Host string + Header map[string]string + Auther auth.Authenticator + Rewrite []HTTPURLRewriteSetting } type TLSNodeSettings struct { @@ -37,8 +45,6 @@ type NodeOptions struct { Path string HTTP *HTTPNodeSettings TLS *TLSNodeSettings - // DEPRECATED by HTTP.Auther - Auther auth.Authenticator } type NodeOption func(*NodeOptions)