begin refactor of proxy engine

This commit is contained in:
Kevin Pham
2023-11-18 08:31:59 -06:00
parent 6d8e943df5
commit f6341f2c3e
24 changed files with 917 additions and 77 deletions

View File

@@ -0,0 +1,21 @@
package rqm // ReQuestModifier
import (
"ladder/proxychain"
"net/url"
)
const googleCacheUrl string = "https://webcache.googleusercontent.com/search?q=cache:"
// RequestGoogleCache modifies a ProxyChain's URL to request its Google Cache version.
func RequestGoogleCache() proxychain.RequestModification {
return func(px *proxychain.ProxyChain) error {
encodedURL := url.QueryEscape(px.Request.URL.String())
newURL, err := url.Parse(googleCacheUrl + encodedURL)
if err != nil {
return err
}
px.Request.URL = newURL
return nil
}
}