Force HTTP1.1 instead of HTTP2 through Proxy (Charles) [closed]
Asked Answered
D

3

14

Since we updated our clients to HTTP2, I've had problems with mapping files to local resources. We normally use Charles (App) to do this, but since we updated to HTTP2, we've had some errors.

It seems to cut the files short and only load a tiny part of the files. Charles then gives a Failure message back saying: Client closed connection before receiving entire response

I've been looking through the big interwebs for answers, but haven't been able to find any yet.

Hopefully there's some brilliant minds in here.

Dobbin answered 15/9, 2016 at 14:19 Comment(8)
Maybe upgrade to Charles 4 which supports HTTP/2.0 ?Calendar
Already did so. It's been happening since I did.Dobbin
I'd look at traffic captures with and without Charles in the middle. Looks like a defect in Charles 4, but worth ruling out client or server misbehaving.Calendar
Still a problem with the latest version of Charles 4.0.2. Is there any way to tell Charles to not support HTTP/2, and force HTTP/1.x?Belen
Charles shows "Push promise disabled due to matching Map Local locations." in case this means anything to anyone.Belen
@Calendar we've looked carefully att traffic and tested different scenarios. It definitely seems to be Charles that is the cause. It cuts our messages off at 16KBPlasterboard
I've noticed if I use http, instead of https, http2 is not used and my local mapping works. I understand this may not be helpful for everybody's situation.Hypanthium
yes, I use Charles 4.0.2. It treat https as h2 default. Whether I use curl or chrome, charles only send 8kb back. And say failure reason "Client closed connection before receiving entire response". According to answers, it a bug of Charles.Leanaleanard
B
3

We have addressed this issue in Charles 4.1.2b2. Please try it out from https://www.charlesproxy.com/download/beta/

Please let me know if this does or doesn't correct the issue for you! We plan to roll out this build to release pretty soon, especially once we've had more users confirm the solution.

Beowulf answered 7/5, 2017 at 1:0 Comment(0)
S
0

One workaround I've found is using the disable-http2 flag when launching Chrome. In MacOS the terminal command would be:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-http2

In windows you could alter your shortcut to launch with that --disable-http2 option.

Selenaselenate answered 27/4, 2017 at 21:34 Comment(0)
A
-1

As you said the problem is raised since client has been updated, have you double check all point relative to any client cache issue ? ( see here about no-caching tool in Charles)

You may use "Upgrade header" to force a change of http protocol version:

The Upgrade header field is a HTTP header field introduced in HTTP/1.1. In the exchange, the client begins by making a cleartext request, which is later upgraded to a newer http protocol version or switched to a different protocol. Connection upgrade must be requested by the client, if the server wants to enforce an upgrade it may send a 426 upgrade required response. The client can then send a new request with the appropriate upgrade headers while keeping the connection open.

Alexandrina answered 5/4, 2017 at 12:26 Comment(1)
but we want to downgrade rather than upgradePlasterboard

© 2022 - 2024 — McMap. All rights reserved.