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

Tunnel agent exception error

Open q349980363 opened this issue 5 years ago • 5 comments

I'm using "Titanium-Web-Proxy" as Nintendo's switch console download accelerator. I use tunnel agents to do this function

var proxyServer = new ProxyServer();
var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Any, 8000, false) {
};
explicitEndPoint.BeforeTunnelConnectRequest += ExplicitEndPoint_BeforeTunnelConnectRequest;
proxyServer.AddEndPoint(explicitEndPoint);
proxyServer.Start();
async private static Task ExplicitEndPoint_BeforeTunnelConnectRequest(object sender, Titanium.Web.Proxy.EventArguments.TunnelConnectSessionEventArgs e) {
            e.DecryptSsl = false;
}

But there was an error downloading the game, and I used Fiddler without the problem

image Use "Titanium-Web-Proxy" as a proxy game opportunity to prompt this error

2005-0140

With Fiddler, there's no such error, that you can download the game normally.

q349980363 avatar Mar 20 '20 15:03 q349980363

image This is me using Fiddler as an upstream agent.

image This is my direct use of Fiddler as an agent.

image

I don't know if it's helpful.

q349980363 avatar Mar 20 '20 15:03 q349980363

Titanium-Web-Proxy-master\src\Titanium.Web.Proxy\ExplicitClientHandler.cs


                    // write back successful CONNECT response
                    var response = ConnectResponse.CreateSuccessfulConnectResponse(connectRequest.HttpVersion);

                    // Set ContentLength explicitly to properly handle HTTP 1.0
                    response.ContentLength = -1;
                    response.Headers.FixProxyHeaders();
                    connectArgs.HttpClient.Response = response;

                    await clientStream.WriteResponseAsync(response, cancellationToken);

I found the wrong cause. I fixed this problem the way I got down there.

response.ContentLength = 0;->response.ContentLength = -1;

q349980363 avatar Mar 22 '20 08:03 q349980363

This line was added by @bjowes : https://github.com/justcoding121/Titanium-Web-Proxy/commit/1d06ec32fc3ac16a9be14aad19196be586abb6d4 and https://github.com/justcoding121/Titanium-Web-Proxy/commit/30870882fdccb4837ebf903647aab8abd05d524e

Is it really needed for HTTP/1.0?

honfika avatar Mar 22 '20 10:03 honfika

This line was added by @bjowes : 1d06ec3 and 3087088

Is it really needed for HTTP/1.0?

Now should no longer exist http 1.0

Should support be provided as an option?

q349980363 avatar Mar 22 '20 10:03 q349980363

Maybe we should add a condition to check if it's HTTP/1.0 in connect request headline and use 0 or -1.

justcoding121 avatar Jun 17 '21 16:06 justcoding121