tunnel: fix tunnel routing for public entrypoint

This commit is contained in:
ginuerzh
2024-11-22 22:04:44 +08:00
parent 2e8a5d6f51
commit 6f001a779a
6 changed files with 61 additions and 19 deletions
+6 -1
View File
@@ -215,7 +215,12 @@ func ParseNode(hop string, cfg *config.NodeConfig, log logger.Logger) (*chain.No
})),
)
}
for _, v := range cfg.HTTP.Rewrite {
rewriteURL := cfg.HTTP.RewriteURL
if rewriteURL == nil {
rewriteURL = cfg.HTTP.Rewrite
}
for _, v := range rewriteURL {
if pattern, _ := regexp.Compile(v.Match); pattern != nil {
settings.RewriteURL = append(settings.RewriteURL, chain.HTTPURLRewriteSetting{
Pattern: pattern,