rewrite resource URLs based on html tokenizer instead of regex

This commit is contained in:
Kevin Pham
2023-11-20 11:38:53 -06:00
parent 5035f65d6b
commit 1d88f14de2
3 changed files with 121 additions and 61 deletions

View File

@@ -49,17 +49,18 @@ func NewProxySiteHandler(opts *ProxyOptions) fiber.Handler {
rs = r
}
*/
proxychain := proxychain.
NewProxyChain().
SetDebugLogging(opts.Verbose).
SetRequestModifications(
rx.DeleteOutgoingCookies(),
).
AddResponseModifications(
tx.DeleteIncomingCookies(),
)
return func(c *fiber.Ctx) error {
proxychain := proxychain.
NewProxyChain().
SetDebugLogging(opts.Verbose).
SetRequestModifications(
rx.DeleteOutgoingCookies(),
).
AddResponseModifications(
tx.DeleteIncomingCookies(),
tx.RewriteHTMLResourceURLs(),
)
return proxychain.SetFiberCtx(c).Execute()
}