Repository navigation
DISCO-184: spike: explore using http-proxy-middleware - #446
Draft
Philipp Koytek (philippkoytek) wants to merge 11 commits into
Draft
Philipp Koytek (philippkoytek) wants to merge 11 commits into
Philipp Koytek (philippkoytek) wants to merge 11 commits into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
…ine-scripts The preview now blocks inline scripts by default, like published apps, and warns about each one with a hint to pass --allow-inline-scripts. Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
Moves the proxy's close() out of the listen callback, uses Sets for the loopback hostnames and bodiless statuses, parses --port without a nested ternary, and asserts that the disconnect test's target request closes. Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
Replaces the hand-written request forwarding, raw-socket WebSocket tunnel, keep-alive agent and TLS handling with http-proxy-middleware. The HTML buffering for inline-script hashing and CSP rewriting stays as a small proxyRes handler. Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
|
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.




Stacked on #444. Spike for DISCO-184: rebuild the preview proxy on http-proxy-middleware to reduce the code we maintain.
What changed
preview-proxy.tsgoes from 207 to 170 lines. The existing proxy spec passes unchanged.For discussion
responseInterceptordoesn't fit: it always rewritescontent-lengthand writes an error message on a mid-body failure, which the current tests forbid. The HTML branch stays hand-written.http-proxydoesn't reliably cancel the upstream request when a client disconnects before the target answers, so a smallres.on("close")hook remains.http-proxy-middlewarev3 builds onhttp-proxy, which gets few updates.Draft: not intended to merge without a team decision.
Co-Authored-By: Claude noreply@anthropic.com
Includes-AI-Code: true