Disable Chrome's HttpsUpgrades feature to fix plain-HTTP proxying - #45
Open
bconik wants to merge 1 commit into
Open
Disable Chrome's HttpsUpgrades feature to fix plain-HTTP proxying#45bconik wants to merge 1 commit into
bconik wants to merge 1 commit into
Conversation
Every plain-HTTP request proxied through thermoptic times out and returns a 502, regardless of the target site. Chrome's HttpsUpgrades feature silently rewrites top-level http:// navigations to https:// before making the real request. cdp.js's manual_browser_visit() registers its CDP Fetch domain interception pattern against the original http:// URL and then calls Page.navigate with that same URL, expecting Fetch.requestPaused to fire once the response comes back. Since the actual outgoing request is for the upgraded https:// URL, the interception pattern never matches, Fetch.requestPaused never fires, and the request sits until the internal timeout fires, surfacing to the client as a 502. Adding HttpsUpgrades to Chrome's --disable-features list stops the silent rewrite so the navigation matches the interception pattern and completes normally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every plain-HTTP request proxied through thermoptic times out and returns a 502, regardless of target site.
Chrome's
HttpsUpgradesfeature silently rewrites top-levelhttp://navigations tohttps://before making the real request.cdp.js'smanual_browser_visit()registers its CDPFetchdomain interception pattern against the originalhttp://URL and then callsPage.navigatewith that same URL, expectingFetch.requestPausedto fire once the response comes back. Since the actual outgoing request is for the upgradedhttps://URL, the interception pattern never matches,Fetch.requestPausednever fires, and the request sits until the internal timeout fires, surfacing to the client as a 502.Adding
HttpsUpgradesto Chrome's--disable-featureslist stops the silent rewrite so the navigation matches the interception pattern and completes normally.