adamfisk / LittleProxy

High performance HTTP proxy originally written by your friends at Lantern and now maintained by a stellar group of volunteer open source programmers.

Home Page:https://www.getlantern.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with HTTP 301/302 with MITM

codersbrew opened this issue · comments

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

When going to https://www.google.com
or e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=561536

I get a loop of HTTP 301/302s that seem to not be completed by the MITM.

It looks like the request is being forwarded with the wrong protocol (http) and getting forced over to https. Will look at this soon.

The issue was that we were getting a CONNECT with a host:port for the server, but the subsequent GET was omitting this host:port. The logic that caches ProxyToServerConnections interpreted this as meaning that we needed to open a new connection to the server, when in fact we should have been reusing the existing one.

I tested this against a real website using Chrome and Firefox and it seems to work now.

I still need to update the unit test for this.

The fix is available on the mitm branch.

@codersbrew Is this working for you now?

@oxtoacart Yes this works now

Excellent!