9 Commits

Author SHA1 Message Date
Kevin Pham
2dcc832993 fix ruleset application bug where rulesets that apply other rulesets are not applied on a single proxychain pass 2023-12-16 14:13:55 -06:00
joncrangle
01efe42fd6 Remove pnpm watch from pre_cmd 2023-12-16 11:49:34 -05:00
joncrangle
251b7e3b55 Add tailwind watch to air; use tailwind native minify 2023-12-16 01:16:44 -05:00
Kevin Pham
88dce971ff tweak error page middleware to return proper json response if on API path 2023-12-15 08:04:09 -06:00
joncrangle
a1b6230f17 Merge branch 'origin/proxy_v2' of https://github.com/everywall/ladder into origin/proxy_v2 2023-12-14 21:53:35 -05:00
joncrangle
e4155f1d07 Undo uncomment of chain._reset 2023-12-14 21:53:33 -05:00
Github action
909bca5a72 Generated stylesheet 2023-12-15 02:51:09 +00:00
joncrangle
e8255bd3a7 Use CreateAPIErrReader for error_page middleware 2023-12-14 21:50:48 -05:00
Kevin Pham
b8fb930987 Merge pull request #69 from everywall/errorpage
Render error page when accept header is text/html
2023-12-12 23:41:10 -06:00
7 changed files with 145 additions and 93 deletions

View File

@@ -36,7 +36,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "AddCacheBusterQuery", Name: "AddCacheBusterQuery",
Description: "AddCacheBusterQuery modifies query params to add a random parameter key In order to get the upstream network stack to serve a fresh copy of the page.", Description: "AddCacheBusterQuery modifies query params to add a random parameter key In order to get the upstream network stack to serve a fresh copy of the page.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/add_cache_buster_query.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/add_cache_buster_query.go",
Params: []Param{ Params: []Param{
}, },
@@ -44,7 +44,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "ForwardRequestHeaders", Name: "ForwardRequestHeaders",
Description: "ForwardRequestHeaders forwards the requests headers sent from the client to the upstream server", Description: "ForwardRequestHeaders forwards the requests headers sent from the client to the upstream server",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/forward_request_headers.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/forward_request_headers.go",
Params: []Param{ Params: []Param{
}, },
@@ -52,7 +52,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "MasqueradeAsGoogleBot", Name: "MasqueradeAsGoogleBot",
Description: "MasqueradeAsGoogleBot modifies user agent and x-forwarded for to appear to be a Google Bot", Description: "MasqueradeAsGoogleBot modifies user agent and x-forwarded for to appear to be a Google Bot",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go",
Params: []Param{ Params: []Param{
}, },
@@ -60,7 +60,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "MasqueradeAsBingBot", Name: "MasqueradeAsBingBot",
Description: "MasqueradeAsBingBot modifies user agent and x-forwarded for to appear to be a Bing Bot", Description: "MasqueradeAsBingBot modifies user agent and x-forwarded for to appear to be a Bing Bot",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go",
Params: []Param{ Params: []Param{
}, },
@@ -68,7 +68,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "MasqueradeAsWaybackMachineBot", Name: "MasqueradeAsWaybackMachineBot",
Description: "MasqueradeAsWaybackMachineBot modifies user agent and x-forwarded for to appear to be a archive.org (wayback machine) Bot", Description: "MasqueradeAsWaybackMachineBot modifies user agent and x-forwarded for to appear to be a archive.org (wayback machine) Bot",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go",
Params: []Param{ Params: []Param{
}, },
@@ -76,7 +76,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "MasqueradeAsFacebookBot", Name: "MasqueradeAsFacebookBot",
Description: "MasqueradeAsFacebookBot modifies user agent and x-forwarded for to appear to be a Facebook Bot (link previews?)", Description: "MasqueradeAsFacebookBot modifies user agent and x-forwarded for to appear to be a Facebook Bot (link previews?)",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go",
Params: []Param{ Params: []Param{
}, },
@@ -84,7 +84,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "MasqueradeAsYandexBot", Name: "MasqueradeAsYandexBot",
Description: "MasqueradeAsYandexBot modifies user agent and x-forwarded for to appear to be a Yandex Spider Bot", Description: "MasqueradeAsYandexBot modifies user agent and x-forwarded for to appear to be a Yandex Spider Bot",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go",
Params: []Param{ Params: []Param{
}, },
@@ -92,7 +92,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "MasqueradeAsBaiduBot", Name: "MasqueradeAsBaiduBot",
Description: "MasqueradeAsBaiduBot modifies user agent and x-forwarded for to appear to be a Baidu Spider Bot", Description: "MasqueradeAsBaiduBot modifies user agent and x-forwarded for to appear to be a Baidu Spider Bot",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go",
Params: []Param{ Params: []Param{
}, },
@@ -100,7 +100,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "MasqueradeAsDuckDuckBot", Name: "MasqueradeAsDuckDuckBot",
Description: "MasqueradeAsDuckDuckBot modifies user agent and x-forwarded for to appear to be a DuckDuckGo Bot", Description: "MasqueradeAsDuckDuckBot modifies user agent and x-forwarded for to appear to be a DuckDuckGo Bot",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go",
Params: []Param{ Params: []Param{
}, },
@@ -108,7 +108,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "MasqueradeAsYahooBot", Name: "MasqueradeAsYahooBot",
Description: "MasqueradeAsYahooBot modifies user agent and x-forwarded for to appear to be a Yahoo Bot", Description: "MasqueradeAsYahooBot modifies user agent and x-forwarded for to appear to be a Yahoo Bot",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/masquerade_as_trusted_bot.go",
Params: []Param{ Params: []Param{
}, },
@@ -116,7 +116,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "ModifyDomainWithRegex", Name: "ModifyDomainWithRegex",
Description: "", Description: "",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/modify_domain_with_regex.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/modify_domain_with_regex.go",
Params: []Param{ Params: []Param{
{Name: "matchRegex", Type: "string"}, {Name: "matchRegex", Type: "string"},
{Name: "replacement", Type: "string"}, {Name: "replacement", Type: "string"},
@@ -125,7 +125,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SetOutgoingCookie", Name: "SetOutgoingCookie",
Description: "SetOutgoingCookie modifes a specific cookie name by modifying the request cookie headers going to the upstream server. If the cookie name does not already exist, it is created.", Description: "SetOutgoingCookie modifes a specific cookie name by modifying the request cookie headers going to the upstream server. If the cookie name does not already exist, it is created.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/modify_outgoing_cookies.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/modify_outgoing_cookies.go",
Params: []Param{ Params: []Param{
{Name: "name", Type: "string"}, {Name: "name", Type: "string"},
{Name: "val", Type: "string"}, {Name: "val", Type: "string"},
@@ -134,7 +134,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SetOutgoingCookies", Name: "SetOutgoingCookies",
Description: "SetOutgoingCookies modifies a client request's cookie header to a raw Cookie string, overwriting existing cookies", Description: "SetOutgoingCookies modifies a client request's cookie header to a raw Cookie string, overwriting existing cookies",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/modify_outgoing_cookies.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/modify_outgoing_cookies.go",
Params: []Param{ Params: []Param{
{Name: "cookies", Type: "string"}, {Name: "cookies", Type: "string"},
}, },
@@ -142,7 +142,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "DeleteOutgoingCookie", Name: "DeleteOutgoingCookie",
Description: "DeleteOutgoingCookie modifies the http request's cookies header to delete a specific request cookie going to the upstream server. If the cookie does not exist, it does not do anything.", Description: "DeleteOutgoingCookie modifies the http request's cookies header to delete a specific request cookie going to the upstream server. If the cookie does not exist, it does not do anything.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/modify_outgoing_cookies.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/modify_outgoing_cookies.go",
Params: []Param{ Params: []Param{
{Name: "name", Type: "string"}, {Name: "name", Type: "string"},
}, },
@@ -150,7 +150,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "DeleteOutgoingCookies", Name: "DeleteOutgoingCookies",
Description: "DeleteOutgoingCookies removes the cookie header entirely, preventing any cookies from reaching the upstream server.", Description: "DeleteOutgoingCookies removes the cookie header entirely, preventing any cookies from reaching the upstream server.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/modify_outgoing_cookies.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/modify_outgoing_cookies.go",
Params: []Param{ Params: []Param{
}, },
@@ -158,7 +158,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "DeleteOutgoingCookiesExcept", Name: "DeleteOutgoingCookiesExcept",
Description: "DeleteOutGoingCookiesExcept prevents non-whitelisted cookies from being sent from the client to the upstream proxy server. Cookies whose names are in the whitelist are not removed.", Description: "DeleteOutGoingCookiesExcept prevents non-whitelisted cookies from being sent from the client to the upstream proxy server. Cookies whose names are in the whitelist are not removed.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/modify_outgoing_cookies.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/modify_outgoing_cookies.go",
Params: []Param{ Params: []Param{
{Name: "whitelist", Type: "&{Ellipsis:12476 Elt:string}"}, {Name: "whitelist", Type: "&{Ellipsis:12476 Elt:string}"},
}, },
@@ -166,7 +166,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "ModifyPathWithRegex", Name: "ModifyPathWithRegex",
Description: "", Description: "",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/modify_path_with_regex.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/modify_path_with_regex.go",
Params: []Param{ Params: []Param{
{Name: "matchRegex", Type: "string"}, {Name: "matchRegex", Type: "string"},
{Name: "replacement", Type: "string"}, {Name: "replacement", Type: "string"},
@@ -175,7 +175,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "ModifyQueryParams", Name: "ModifyQueryParams",
Description: "ModifyQueryParams replaces query parameter values in URL's query params in a ProxyChain's URL. If the query param key doesn't exist, it is created.", Description: "ModifyQueryParams replaces query parameter values in URL's query params in a ProxyChain's URL. If the query param key doesn't exist, it is created.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/modify_query_params.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/modify_query_params.go",
Params: []Param{ Params: []Param{
{Name: "key", Type: "string"}, {Name: "key", Type: "string"},
{Name: "value", Type: "string"}, {Name: "value", Type: "string"},
@@ -184,7 +184,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SetRequestHeader", Name: "SetRequestHeader",
Description: "SetRequestHeader modifies a specific outgoing header This is the header that the upstream server will see.", Description: "SetRequestHeader modifies a specific outgoing header This is the header that the upstream server will see.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/modify_request_headers.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/modify_request_headers.go",
Params: []Param{ Params: []Param{
{Name: "name", Type: "string"}, {Name: "name", Type: "string"},
{Name: "val", Type: "string"}, {Name: "val", Type: "string"},
@@ -193,7 +193,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "DeleteRequestHeader", Name: "DeleteRequestHeader",
Description: "DeleteRequestHeader modifies a specific outgoing header This is the header that the upstream server will see.", Description: "DeleteRequestHeader modifies a specific outgoing header This is the header that the upstream server will see.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/modify_request_headers.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/modify_request_headers.go",
Params: []Param{ Params: []Param{
{Name: "name", Type: "string"}, {Name: "name", Type: "string"},
}, },
@@ -201,7 +201,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "RequestArchiveIs", Name: "RequestArchiveIs",
Description: "RequestArchiveIs modifies a ProxyChain's URL to request an archived version from archive.is", Description: "RequestArchiveIs modifies a ProxyChain's URL to request an archived version from archive.is",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/request_archive_is.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/request_archive_is.go",
Params: []Param{ Params: []Param{
}, },
@@ -209,7 +209,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "RequestGoogleCache", Name: "RequestGoogleCache",
Description: "RequestGoogleCache modifies a ProxyChain's URL to request its Google Cache version.", Description: "RequestGoogleCache modifies a ProxyChain's URL to request its Google Cache version.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/request_google_cache.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/request_google_cache.go",
Params: []Param{ Params: []Param{
}, },
@@ -217,7 +217,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "RequestWaybackMachine", Name: "RequestWaybackMachine",
Description: "RequestWaybackMachine modifies a ProxyChain's URL to request the wayback machine (archive.org) version.", Description: "RequestWaybackMachine modifies a ProxyChain's URL to request the wayback machine (archive.org) version.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/request_wayback_machine.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/request_wayback_machine.go",
Params: []Param{ Params: []Param{
}, },
@@ -225,7 +225,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "ResolveWithGoogleDoH", Name: "ResolveWithGoogleDoH",
Description: "ResolveWithGoogleDoH modifies a ProxyChain's client to make the request by resolving the URL using Google's DNS over HTTPs service", Description: "ResolveWithGoogleDoH modifies a ProxyChain's client to make the request by resolving the URL using Google's DNS over HTTPs service",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/resolve_with_google_doh.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/resolve_with_google_doh.go",
Params: []Param{ Params: []Param{
}, },
@@ -233,7 +233,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofOrigin", Name: "SpoofOrigin",
Description: "SpoofOrigin modifies the origin header if the upstream server returns a Vary header it means you might get a different response if you change this", Description: "SpoofOrigin modifies the origin header if the upstream server returns a Vary header it means you might get a different response if you change this",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_origin.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_origin.go",
Params: []Param{ Params: []Param{
{Name: "url", Type: "string"}, {Name: "url", Type: "string"},
}, },
@@ -241,7 +241,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "HideOrigin", Name: "HideOrigin",
Description: "HideOrigin modifies the origin header so that it is the original origin, not the proxy", Description: "HideOrigin modifies the origin header so that it is the original origin, not the proxy",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_origin.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_origin.go",
Params: []Param{ Params: []Param{
}, },
@@ -249,7 +249,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofReferrer", Name: "SpoofReferrer",
Description: "SpoofReferrer modifies the referrer header. It is useful if the page can be accessed from a search engine or social media site, but not by browsing the website itself. if url is \"\", then the referrer header is removed.", Description: "SpoofReferrer modifies the referrer header. It is useful if the page can be accessed from a search engine or social media site, but not by browsing the website itself. if url is \"\", then the referrer header is removed.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer.go",
Params: []Param{ Params: []Param{
{Name: "url", Type: "string"}, {Name: "url", Type: "string"},
}, },
@@ -257,7 +257,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "HideReferrer", Name: "HideReferrer",
Description: "HideReferrer modifies the referrer header so that it is the original referrer, not the proxy", Description: "HideReferrer modifies the referrer header so that it is the original referrer, not the proxy",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer.go",
Params: []Param{ Params: []Param{
}, },
@@ -265,7 +265,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofReferrerFromBaiduSearch", Name: "SpoofReferrerFromBaiduSearch",
Description: "SpoofReferrerFromBaiduSearch modifies the referrer header pretending to be from a BaiduSearch", Description: "SpoofReferrerFromBaiduSearch modifies the referrer header pretending to be from a BaiduSearch",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_baidu_post.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_baidu_post.go",
Params: []Param{ Params: []Param{
}, },
@@ -273,7 +273,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofReferrerFromBingSearch", Name: "SpoofReferrerFromBingSearch",
Description: "SpoofReferrerFromBingSearch modifies the referrer header pretending to be from a bing search site", Description: "SpoofReferrerFromBingSearch modifies the referrer header pretending to be from a bing search site",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_bing_search.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_bing_search.go",
Params: []Param{ Params: []Param{
}, },
@@ -281,7 +281,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofReferrerFromGoogleSearch", Name: "SpoofReferrerFromGoogleSearch",
Description: "SpoofReferrerFromGoogleSearch modifies the referrer header pretending to be from a google search site", Description: "SpoofReferrerFromGoogleSearch modifies the referrer header pretending to be from a google search site",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_google_search.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_google_search.go",
Params: []Param{ Params: []Param{
}, },
@@ -289,7 +289,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofReferrerFromLinkedInPost", Name: "SpoofReferrerFromLinkedInPost",
Description: "SpoofReferrerFromLinkedInPost modifies the referrer header pretending to be from a linkedin post", Description: "SpoofReferrerFromLinkedInPost modifies the referrer header pretending to be from a linkedin post",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_linkedin_post.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_linkedin_post.go",
Params: []Param{ Params: []Param{
}, },
@@ -297,7 +297,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofReferrerFromNaverSearch", Name: "SpoofReferrerFromNaverSearch",
Description: "SpoofReferrerFromNaverSearch modifies the referrer header pretending to be from a Naver search (popular in South Korea)", Description: "SpoofReferrerFromNaverSearch modifies the referrer header pretending to be from a Naver search (popular in South Korea)",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_naver_post.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_naver_post.go",
Params: []Param{ Params: []Param{
}, },
@@ -305,7 +305,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofReferrerFromPinterestPost", Name: "SpoofReferrerFromPinterestPost",
Description: "SpoofReferrerFromPinterestPost modifies the referrer header pretending to be from a pinterest post", Description: "SpoofReferrerFromPinterestPost modifies the referrer header pretending to be from a pinterest post",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_pinterest_post.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_pinterest_post.go",
Params: []Param{ Params: []Param{
}, },
@@ -313,7 +313,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofReferrerFromQQPost", Name: "SpoofReferrerFromQQPost",
Description: "SpoofReferrerFromQQPost modifies the referrer header pretending to be from a QQ post (popular social media in China)", Description: "SpoofReferrerFromQQPost modifies the referrer header pretending to be from a QQ post (popular social media in China)",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_qq_post.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_qq_post.go",
Params: []Param{ Params: []Param{
}, },
@@ -321,7 +321,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofReferrerFromRedditPost", Name: "SpoofReferrerFromRedditPost",
Description: "SpoofReferrerFromRedditPost modifies the referrer header pretending to be from a reddit post", Description: "SpoofReferrerFromRedditPost modifies the referrer header pretending to be from a reddit post",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_reddit_post.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_reddit_post.go",
Params: []Param{ Params: []Param{
}, },
@@ -329,7 +329,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofReferrerFromTumblrPost", Name: "SpoofReferrerFromTumblrPost",
Description: "SpoofReferrerFromTumblrPost modifies the referrer header pretending to be from a tumblr post", Description: "SpoofReferrerFromTumblrPost modifies the referrer header pretending to be from a tumblr post",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_tumblr_post.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_tumblr_post.go",
Params: []Param{ Params: []Param{
}, },
@@ -337,7 +337,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofReferrerFromTwitterPost", Name: "SpoofReferrerFromTwitterPost",
Description: "SpoofReferrerFromTwitterPost modifies the referrer header pretending to be from a twitter post", Description: "SpoofReferrerFromTwitterPost modifies the referrer header pretending to be from a twitter post",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_twitter_post.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_twitter_post.go",
Params: []Param{ Params: []Param{
}, },
@@ -345,7 +345,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofReferrerFromVkontaktePost", Name: "SpoofReferrerFromVkontaktePost",
Description: "SpoofReferrerFromVkontaktePost modifies the referrer header pretending to be from a vkontakte post (popular in Russia)", Description: "SpoofReferrerFromVkontaktePost modifies the referrer header pretending to be from a vkontakte post (popular in Russia)",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_vkontake_post.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_vkontake_post.go",
Params: []Param{ Params: []Param{
}, },
@@ -353,7 +353,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofReferrerFromWeiboPost", Name: "SpoofReferrerFromWeiboPost",
Description: "SpoofReferrerFromWeiboPost modifies the referrer header pretending to be from a Weibo post (popular in China)", Description: "SpoofReferrerFromWeiboPost modifies the referrer header pretending to be from a Weibo post (popular in China)",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_weibo_post.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_referrer_from_weibo_post.go",
Params: []Param{ Params: []Param{
}, },
@@ -361,7 +361,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofUserAgent", Name: "SpoofUserAgent",
Description: "SpoofUserAgent modifies the user agent", Description: "SpoofUserAgent modifies the user agent",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_user_agent.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_user_agent.go",
Params: []Param{ Params: []Param{
{Name: "ua", Type: "string"}, {Name: "ua", Type: "string"},
}, },
@@ -369,7 +369,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SpoofXForwardedFor", Name: "SpoofXForwardedFor",
Description: "SpoofXForwardedFor modifies the X-Forwarded-For header in some cases, a forward proxy may interpret this as the source IP", Description: "SpoofXForwardedFor modifies the X-Forwarded-For header in some cases, a forward proxy may interpret this as the source IP",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/requestmodifiers/spoof_x_forwarded_for.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/requestmodifiers/spoof_x_forwarded_for.go",
Params: []Param{ Params: []Param{
{Name: "ip", Type: "string"}, {Name: "ip", Type: "string"},
}, },
@@ -379,7 +379,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "APIContent", Name: "APIContent",
Description: "APIContent creates an JSON representation of the article and returns it as an API response.", Description: "APIContent creates an JSON representation of the article and returns it as an API response.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/api_content.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/api_content.go",
Params: []Param{ Params: []Param{
}, },
@@ -387,7 +387,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "BlockElementRemoval", Name: "BlockElementRemoval",
Description: "BlockElementRemoval prevents paywall javascript from removing a particular element by detecting the removal, then immediately reinserting it. This is useful when a page will return a \"fake\" 404, after flashing the content briefly. If the /outline/ API works, but the regular API doesn't, try this modifier.", Description: "BlockElementRemoval prevents paywall javascript from removing a particular element by detecting the removal, then immediately reinserting it. This is useful when a page will return a \"fake\" 404, after flashing the content briefly. If the /outline/ API works, but the regular API doesn't, try this modifier.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/block_element_removal.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/block_element_removal.go",
Params: []Param{ Params: []Param{
{Name: "cssSelector", Type: "string"}, {Name: "cssSelector", Type: "string"},
}, },
@@ -395,7 +395,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "BlockThirdPartyScripts", Name: "BlockThirdPartyScripts",
Description: "BlockThirdPartyScripts rewrites HTML and injects JS to block all third party JS from loading.", Description: "BlockThirdPartyScripts rewrites HTML and injects JS to block all third party JS from loading.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/block_third_party_scripts.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/block_third_party_scripts.go",
Params: []Param{ Params: []Param{
}, },
@@ -403,7 +403,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "BypassCORS", Name: "BypassCORS",
Description: "BypassCORS modifies response headers to prevent the browser from enforcing any CORS restrictions. This should run at the end of the chain.", Description: "BypassCORS modifies response headers to prevent the browser from enforcing any CORS restrictions. This should run at the end of the chain.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/bypass_cors.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/bypass_cors.go",
Params: []Param{ Params: []Param{
}, },
@@ -411,7 +411,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "BypassContentSecurityPolicy", Name: "BypassContentSecurityPolicy",
Description: "BypassContentSecurityPolicy modifies response headers to prevent the browser from enforcing any CSP restrictions. This should run at the end of the chain.", Description: "BypassContentSecurityPolicy modifies response headers to prevent the browser from enforcing any CSP restrictions. This should run at the end of the chain.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/bypass_csp.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/bypass_csp.go",
Params: []Param{ Params: []Param{
}, },
@@ -419,7 +419,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SetContentSecurityPolicy", Name: "SetContentSecurityPolicy",
Description: "SetContentSecurityPolicy modifies response headers to a specific CSP", Description: "SetContentSecurityPolicy modifies response headers to a specific CSP",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/bypass_csp.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/bypass_csp.go",
Params: []Param{ Params: []Param{
{Name: "csp", Type: "string"}, {Name: "csp", Type: "string"},
}, },
@@ -427,7 +427,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "DeleteLocalStorageData", Name: "DeleteLocalStorageData",
Description: "DeleteLocalStorageData deletes localstorage cookies. If the page works once in a fresh incognito window, but fails for subsequent loads, try this response modifier alongside DeleteSessionStorageData and DeleteIncomingCookies", Description: "DeleteLocalStorageData deletes localstorage cookies. If the page works once in a fresh incognito window, but fails for subsequent loads, try this response modifier alongside DeleteSessionStorageData and DeleteIncomingCookies",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/delete_localstorage_data.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/delete_localstorage_data.go",
Params: []Param{ Params: []Param{
}, },
@@ -435,7 +435,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "DeleteSessionStorageData", Name: "DeleteSessionStorageData",
Description: "DeleteSessionStorageData deletes localstorage cookies. If the page works once in a fresh incognito window, but fails for subsequent loads, try this response modifier alongside DeleteLocalStorageData and DeleteIncomingCookies", Description: "DeleteSessionStorageData deletes localstorage cookies. If the page works once in a fresh incognito window, but fails for subsequent loads, try this response modifier alongside DeleteLocalStorageData and DeleteIncomingCookies",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/delete_sessionstorage_data.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/delete_sessionstorage_data.go",
Params: []Param{ Params: []Param{
}, },
@@ -443,7 +443,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "ForwardResponseHeaders", Name: "ForwardResponseHeaders",
Description: "ForwardResponseHeaders forwards the response headers from the upstream server to the client", Description: "ForwardResponseHeaders forwards the response headers from the upstream server to the client",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/forward_response_headers.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/forward_response_headers.go",
Params: []Param{ Params: []Param{
}, },
@@ -451,7 +451,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "GenerateReadableOutline", Name: "GenerateReadableOutline",
Description: "GenerateReadableOutline creates an reader-friendly distilled representation of the article. This is a reliable way of bypassing soft-paywalled articles, where the content is hidden, but still present in the DOM.", Description: "GenerateReadableOutline creates an reader-friendly distilled representation of the article. This is a reliable way of bypassing soft-paywalled articles, where the content is hidden, but still present in the DOM.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/generate_readable_outline.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/generate_readable_outline.go",
Params: []Param{ Params: []Param{
}, },
@@ -459,7 +459,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "InjectScriptBeforeDOMContentLoaded", Name: "InjectScriptBeforeDOMContentLoaded",
Description: "InjectScriptBeforeDOMContentLoaded modifies HTTP responses to inject a JS before DOM Content is loaded (script tag in head)", Description: "InjectScriptBeforeDOMContentLoaded modifies HTTP responses to inject a JS before DOM Content is loaded (script tag in head)",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/inject_script.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/inject_script.go",
Params: []Param{ Params: []Param{
{Name: "js", Type: "string"}, {Name: "js", Type: "string"},
}, },
@@ -467,7 +467,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "InjectScriptAfterDOMContentLoaded", Name: "InjectScriptAfterDOMContentLoaded",
Description: "InjectScriptAfterDOMContentLoaded modifies HTTP responses to inject a JS after DOM Content is loaded (script tag in head)", Description: "InjectScriptAfterDOMContentLoaded modifies HTTP responses to inject a JS after DOM Content is loaded (script tag in head)",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/inject_script.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/inject_script.go",
Params: []Param{ Params: []Param{
{Name: "js", Type: "string"}, {Name: "js", Type: "string"},
}, },
@@ -475,7 +475,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "InjectScriptAfterDOMIdle", Name: "InjectScriptAfterDOMIdle",
Description: "InjectScriptAfterDOMIdle modifies HTTP responses to inject a JS after the DOM is idle (ie: js framework loaded)", Description: "InjectScriptAfterDOMIdle modifies HTTP responses to inject a JS after the DOM is idle (ie: js framework loaded)",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/inject_script.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/inject_script.go",
Params: []Param{ Params: []Param{
{Name: "js", Type: "string"}, {Name: "js", Type: "string"},
}, },
@@ -483,7 +483,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "DeleteIncomingCookies", Name: "DeleteIncomingCookies",
Description: "DeleteIncomingCookies prevents ALL cookies from being sent from the proxy server back down to the client.", Description: "DeleteIncomingCookies prevents ALL cookies from being sent from the proxy server back down to the client.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/modify_incoming_cookies.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/modify_incoming_cookies.go",
Params: []Param{ Params: []Param{
{Name: "_", Type: "&{Ellipsis:18780 Elt:string}"}, {Name: "_", Type: "&{Ellipsis:18780 Elt:string}"},
}, },
@@ -491,7 +491,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "DeleteIncomingCookiesExcept", Name: "DeleteIncomingCookiesExcept",
Description: "DeleteIncomingCookiesExcept prevents non-whitelisted cookies from being sent from the proxy server to the client. Cookies whose names are in the whitelist are not removed.", Description: "DeleteIncomingCookiesExcept prevents non-whitelisted cookies from being sent from the proxy server to the client. Cookies whose names are in the whitelist are not removed.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/modify_incoming_cookies.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/modify_incoming_cookies.go",
Params: []Param{ Params: []Param{
{Name: "whitelist", Type: "&{Ellipsis:19325 Elt:string}"}, {Name: "whitelist", Type: "&{Ellipsis:19325 Elt:string}"},
}, },
@@ -499,7 +499,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SetIncomingCookies", Name: "SetIncomingCookies",
Description: "SetIncomingCookies adds a raw cookie string being sent from the proxy server down to the client", Description: "SetIncomingCookies adds a raw cookie string being sent from the proxy server down to the client",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/modify_incoming_cookies.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/modify_incoming_cookies.go",
Params: []Param{ Params: []Param{
{Name: "cookies", Type: "string"}, {Name: "cookies", Type: "string"},
}, },
@@ -507,7 +507,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SetIncomingCookie", Name: "SetIncomingCookie",
Description: "SetIncomingCookie modifies a specific cookie in the response from the proxy server to the client.", Description: "SetIncomingCookie modifies a specific cookie in the response from the proxy server to the client.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/modify_incoming_cookies.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/modify_incoming_cookies.go",
Params: []Param{ Params: []Param{
{Name: "name", Type: "string"}, {Name: "name", Type: "string"},
{Name: "val", Type: "string"}, {Name: "val", Type: "string"},
@@ -516,7 +516,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "ModifyIncomingScriptsWithRegex", Name: "ModifyIncomingScriptsWithRegex",
Description: "ModifyIncomingScriptsWithRegex modifies all incoming javascript (application/javascript and inline <script> in text/html) using a regex match and replacement.", Description: "ModifyIncomingScriptsWithRegex modifies all incoming javascript (application/javascript and inline <script> in text/html) using a regex match and replacement.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/modify_incoming_scripts_with_regex.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/modify_incoming_scripts_with_regex.go",
Params: []Param{ Params: []Param{
{Name: "matchRegex", Type: "string"}, {Name: "matchRegex", Type: "string"},
{Name: "replacement", Type: "string"}, {Name: "replacement", Type: "string"},
@@ -525,7 +525,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "SetResponseHeader", Name: "SetResponseHeader",
Description: "SetResponseHeader modifies response headers from the upstream server", Description: "SetResponseHeader modifies response headers from the upstream server",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/modify_response_header.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/modify_response_header.go",
Params: []Param{ Params: []Param{
{Name: "key", Type: "string"}, {Name: "key", Type: "string"},
{Name: "value", Type: "string"}, {Name: "value", Type: "string"},
@@ -534,7 +534,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "DeleteResponseHeader", Name: "DeleteResponseHeader",
Description: "DeleteResponseHeader removes response headers from the upstream server", Description: "DeleteResponseHeader removes response headers from the upstream server",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/modify_response_header.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/modify_response_header.go",
Params: []Param{ Params: []Param{
{Name: "key", Type: "string"}, {Name: "key", Type: "string"},
}, },
@@ -542,7 +542,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "PatchDynamicResourceURLs", Name: "PatchDynamicResourceURLs",
Description: "PatchDynamicResourceURLs patches the javascript runtime to rewrite URLs client-side. - This function is designed to allow the proxified page to still be browsible by routing all resource URLs through the proxy. - Native APIs capable of network requests will be hooked and the URLs arguments modified to point to the proxy instead. - fetch('/relative_path') -> fetch('/https://proxiedsite.com/relative_path') - Element.setAttribute('src', \"/assets/img.jpg\") -> Element.setAttribute('src', \"/https://proxiedsite.com/assets/img.jpg\") -> fetch('/https://proxiedsite.com/relative_path')", Description: "PatchDynamicResourceURLs patches the javascript runtime to rewrite URLs client-side. - This function is designed to allow the proxified page to still be browsible by routing all resource URLs through the proxy. - Native APIs capable of network requests will be hooked and the URLs arguments modified to point to the proxy instead. - fetch('/relative_path') -> fetch('/https://proxiedsite.com/relative_path') - Element.setAttribute('src', \"/assets/img.jpg\") -> Element.setAttribute('src', \"/https://proxiedsite.com/assets/img.jpg\") -> fetch('/https://proxiedsite.com/relative_path')",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/patch_dynamic_resource_urls.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/patch_dynamic_resource_urls.go",
Params: []Param{ Params: []Param{
}, },
@@ -550,7 +550,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "PatchTrackerScripts", Name: "PatchTrackerScripts",
Description: "PatchTrackerScripts replaces any request to tracker scripts such as google analytics with a no-op stub that mocks the API structure of the original scripts they replace. Some pages depend on the existence of these structures for proper loading, so this may fix some broken elements. Surrogate script code borrowed from: DuckDuckGo Privacy Essentials browser extension for Firefox, Chrome. (Apache 2.0 license)", Description: "PatchTrackerScripts replaces any request to tracker scripts such as google analytics with a no-op stub that mocks the API structure of the original scripts they replace. Some pages depend on the existence of these structures for proper loading, so this may fix some broken elements. Surrogate script code borrowed from: DuckDuckGo Privacy Essentials browser extension for Firefox, Chrome. (Apache 2.0 license)",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/patch_tracker_scripts.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/patch_tracker_scripts.go",
Params: []Param{ Params: []Param{
}, },
@@ -558,7 +558,7 @@ var AllMods Modifiers = Modifiers{
{ {
Name: "RewriteHTMLResourceURLs", Name: "RewriteHTMLResourceURLs",
Description: "RewriteHTMLResourceURLs modifies HTTP responses to rewrite URLs attributes in HTML content (such as src, href) - `<img src='/relative_path'>` -> `<img src='/https://proxiedsite.com/relative_path'>` - This function is designed to allow the proxified page to still be browsible by routing all resource URLs through the proxy.", Description: "RewriteHTMLResourceURLs modifies HTTP responses to rewrite URLs attributes in HTML content (such as src, href) - `<img src='/relative_path'>` -> `<img src='/https://proxiedsite.com/relative_path'>` - This function is designed to allow the proxified page to still be browsible by routing all resource URLs through the proxy.",
CodeEditLink: "https://github.com/everywall/ladder.git/edit/heads/origin/proxy_v2/proxychain/responsemodifiers/rewrite_http_resource_urls.go", CodeEditLink: "https://github.com/everywall/ladder/edit/origin/proxy_v2/proxychain/responsemodifiers/rewrite_http_resource_urls.go",
Params: []Param{ Params: []Param{
}, },

View File

@@ -2,10 +2,14 @@ package handlers
import ( import (
"embed" "embed"
"encoding/json"
"fmt" "fmt"
"html/template" "html/template"
"io"
"net/http"
"strings" "strings"
"github.com/everywall/ladder/proxychain/responsemodifiers/api"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
) )
@@ -20,12 +24,40 @@ func RenderErrorPage() fiber.Handler {
} }
return func(c *fiber.Ctx) error { return func(c *fiber.Ctx) error {
if err := c.Next(); err != nil { if err := c.Next(); err != nil {
c.Response().SetStatusCode(500)
errReader := api.CreateAPIErrReader(err)
if strings.HasPrefix(c.Path(), "/api/") {
c.Set("Content-Type", "application/json")
return c.SendStream(errReader)
}
errMessageBytes, err := io.ReadAll(errReader)
if err != nil {
return err
}
var errMsg api.Error
if err := json.Unmarshal(errMessageBytes, &errMsg); err != nil {
return err
}
if strings.Contains(c.Get("Accept"), "text/plain") {
c.Set("Content-Type", "text/plain")
return c.SendString(errMsg.Error.Message)
}
if strings.Contains(c.Get("Accept"), "text/html") { if strings.Contains(c.Get("Accept"), "text/html") {
c.Set("Content-Type", "text/html") c.Set("Content-Type", "text/html")
tmpl.Execute(c.Response().BodyWriter(), err.Error()) tmpl.Execute(c.Response().BodyWriter(), fiber.Map{
"Status": http.StatusText(c.Response().StatusCode()) + ": " + fmt.Sprint(c.Response().StatusCode()),
"Message": errMsg.Error.Message,
"Type": errMsg.Error.Type,
"Cause": errMsg.Error.Cause,
})
return nil return nil
} }
return c.SendString(err.Error()) c.Set("Content-Type", "application/json")
return c.JSON(errMsg)
} }
return err return err
} }

View File

@@ -214,7 +214,14 @@
<div class="flex flex-col space-y-3"> <div class="flex flex-col space-y-3">
<h1>Error</h1> <h1>Error</h1>
<div class="my-4"></div> <div class="my-4"></div>
<code class="p-4 mx-auto text-red-500 dark:text-red-400"> {{.}} </code> <pre
class="mx-auto px-6 py-4 space-y-3 whitespace-normal break-all text-red-500 dark:text-red-400"
>
<div><span class="underline">{{.Status}}</span></div>
<div>{{.Message}}</div>
<div><span class="underline">Type</span>:&nbsp;{{.Type}}</div>
<div><span class="underline">Cause</span>:&nbsp;{{.Cause}}</div>
</pre>
</div> </div>
<footer class="mx-4 my-2 text-center text-slate-600 dark:text-slate-400"> <footer class="mx-4 my-2 text-center text-slate-600 dark:text-slate-400">

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,9 @@
{ {
"scripts": { "scripts": {
"build": "pnpx tailwindcss -i ./styles/input.css -o ./styles/output.css --build && pnpx minify ./styles/output.css > ./handlers/styles.css" "build": "pnpx tailwindcss -i ./styles/input.css -o ./styles/output.css --build --minify",
"watch": "pnpx tailwindcss -i ./styles/input.css -o ./styles/output.css --build --minify --watch"
}, },
"devDependencies": { "devDependencies": {
"minify": "^10.5.2", "tailwindcss": "^3.3.6"
"tailwindcss": "^3.3.5"
} }
} }

View File

@@ -156,6 +156,13 @@ func (chain *ProxyChain) AddOnceResponseModifications(mods ...ResponseModificati
// AddResponseModifications sets the ProxyChain's response modifiers // AddResponseModifications sets the ProxyChain's response modifiers
// the modifier will not fire until ProxyChain.Execute() is run. // the modifier will not fire until ProxyChain.Execute() is run.
func (chain *ProxyChain) AddResponseModifications(mods ...ResponseModification) *ProxyChain { func (chain *ProxyChain) AddResponseModifications(mods ...ResponseModification) *ProxyChain {
chain.responseModifications = append(chain.responseModifications, mods...)
return chain
}
// SetResponseModifications sets the ProxyChain's response modifiers
// the modifier will not fire until ProxyChain.Execute() is run.
func (chain *ProxyChain) SetResponseModifications(mods ...ResponseModification) *ProxyChain {
chain.responseModifications = mods chain.responseModifications = mods
return chain return chain
} }
@@ -392,16 +399,16 @@ func (chain *ProxyChain) SetDebugLogging(isDebugMode bool) *ProxyChain {
func (chain *ProxyChain) abort(err error) error { func (chain *ProxyChain) abort(err error) error {
// defer chain._reset() // defer chain._reset()
chain.abortErr = err chain.abortErr = err
chain.Context.Response().SetStatusCode(500) // chain.Context.Response().SetStatusCode(500)
var e error // var e error
if chain.Request.URL != nil { // if chain.Request.URL != nil {
e = fmt.Errorf("ProxyChain error for '%s': %s", chain.Request.URL.String(), err.Error()) // e = fmt.Errorf("ProxyChain error for '%s': %s", chain.Request.URL.String(), err.Error())
} else { // } else {
e = fmt.Errorf("ProxyChain error: '%s'", err.Error()) // e = fmt.Errorf("ProxyChain error: '%s'", err.Error())
} // }
// chain.Context.SendString(e.Error()) // <- RenderErrorPage middleware to render error // chain.Context.SendString(e.Error()) // <- RenderErrorPage middleware to render error
log.Println(e.Error()) // log.Println(e.Error())
return e return err
} }
// internal function to reset state of ProxyChain for reuse // internal function to reset state of ProxyChain for reuse
@@ -462,13 +469,16 @@ func (chain *ProxyChain) _execute() (io.Reader, error) {
} }
// Apply onceRequestModifications to proxychain and clear them // Apply onceRequestModifications to proxychain and clear them
for _, applyOnceRequestModificationsTo := range chain.onceRequestModifications { for len(chain.onceRequestModifications) > 0 {
err := applyOnceRequestModificationsTo(chain) i := 0
modFn := chain.onceRequestModifications[i]
err := modFn(chain)
if err != nil { if err != nil {
return nil, chain.abort(err) return nil, chain.abort(err)
} }
// pop modFn off slice
chain.onceRequestModifications = append(chain.onceRequestModifications[:i], chain.onceRequestModifications[i+1:]...)
} }
chain.onceRequestModifications = []RequestModification{}
// ======== SEND REQUEST UPSTREAM :: client -> [ladder -> upstream] -> ladder -> client ============================= // ======== SEND REQUEST UPSTREAM :: client -> [ladder -> upstream] -> ladder -> client =============================
// Send Request Upstream // Send Request Upstream
@@ -499,13 +509,16 @@ func (chain *ProxyChain) _execute() (io.Reader, error) {
} }
// Apply onceResponseModifications to proxychain and clear them // Apply onceResponseModifications to proxychain and clear them
for _, applyOnceResponseModificationsTo := range chain.onceResponseModifications { for len(chain.onceResponseModifications) > 0 {
err := applyOnceResponseModificationsTo(chain) i := 0
modFn := chain.onceResponseModifications[i]
err := modFn(chain)
if err != nil { if err != nil {
return nil, chain.abort(err) return nil, chain.abort(err)
} }
// pop modFn off slice
chain.onceResponseModifications = append(chain.onceResponseModifications[:i], chain.onceResponseModifications[i+1:]...)
} }
chain.onceResponseModifications = []ResponseModification{}
// ======== RETURN BODY TO CLIENT :: client -> ladder -> upstream -> [ladder -> client] ============================= // ======== RETURN BODY TO CLIENT :: client -> ladder -> upstream -> [ladder -> client] =============================
return chain.Response.Body, nil return chain.Response.Body, nil

View File

@@ -26,7 +26,7 @@
kbd, kbd,
pre, pre,
code { code {
@apply relative whitespace-break-spaces rounded bg-slate-200 dark:bg-slate-800 py-[0.2rem] font-mono text-sm font-semibold; @apply relative whitespace-break-spaces break-words rounded bg-slate-200 dark:bg-slate-800 py-[0.2rem] font-mono text-sm font-semibold;
} }
blockquote { blockquote {
@apply mt-6 border-l-2 pl-6 italic; @apply mt-6 border-l-2 pl-6 italic;