titanium-web-proxy icon indicating copy to clipboard operation
titanium-web-proxy copied to clipboard

Redirecting to another proxy server

Open Raepheles opened this issue 4 years ago • 0 comments

Hello,

I'm using titanium web proxy to redirect certain requests to another proxy server and do nothing for others. I've achieved it this way:

public async Task OnRequest(object sender, SessionEventArgs e) {
    if (...) {
        e.CustomUpStreamProxy = externalProxy;
        await writeToConsole(string.Format("{0} uses proxy", e.HttpClient.Request.Url));
    } else {
        await writeToConsole(string.Format("{0} doesn't use proxy", e.HttpClient.Request.Url));
    }
}

And it seems to be working since I've tested it on several web pages that can only be viewed if you use this 2nd proxy (externalProxy in the code) I've mentioned. But there is one problem in one of the pages which loads a script from yandex maps api. When I connect to my proxy server following happens:

  • Page loads
  • Page cannot load that yandex maps script (gives ERR_CONNECTION_RESET error on console.)
  • I see "{url here} uses proxy" log on console which means this connection has been relayed to external proxy.

But if I remove my proxy server from the equation and directly connect to this external proxy I get no error and page loads the script.

What might be the problem here?

Raepheles avatar Apr 13 '20 00:04 Raepheles