add custom http response header for reverse proxy

This commit is contained in:
ginuerzh
2024-11-07 11:04:42 +08:00
parent a12870e766
commit 3db20563d2
5 changed files with 19 additions and 5 deletions
+2
View File
@@ -398,6 +398,8 @@ type HTTPNodeConfig struct {
Host string `yaml:",omitempty" json:"host,omitempty"`
// additional request header
Header map[string]string `yaml:",omitempty" json:"header,omitempty"`
// additional response header
ResponseHeader map[string]string `yaml:",omitempty" json:"responseHeader,omitempty"`
// rewrite URL
Rewrite []HTTPURLRewriteConfig `yaml:",omitempty" json:"rewrite,omitempty"`
// rewrite response body
+3 -2
View File
@@ -177,8 +177,9 @@ func ParseNode(hop string, cfg *config.NodeConfig, log logger.Logger) (*chain.No
if cfg.HTTP != nil {
settings := &chain.HTTPNodeSettings{
Host: cfg.HTTP.Host,
Header: cfg.HTTP.Header,
Host: cfg.HTTP.Host,
Header: cfg.HTTP.Header,
ResponseHeader: cfg.HTTP.ResponseHeader,
}
if auth := cfg.HTTP.Auth; auth != nil && auth.Username != "" {