Repository navigation
Proxy Support - #2831
Merged
Merged
Proxy Support#2831
Conversation
Contributor
|
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
blittle
commented
Apr 1, 2025
Comment on lines
-240
to
-241
| // https://github.com/cloudflare/workers-sdk/issues/5345 | ||
| response.headers.delete('Content-Encoding'); |
Contributor
Author
There was a problem hiding this comment.
This issue does not appear to be a problem anymore.
4 of 6 tasks
blittle
commented
Apr 1, 2025
ruggishop
approved these changes
Apr 1, 2025
| const useOutboundService = | ||
| isNormalWorker && | ||
| (process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0' || | ||
| process.env.SHOPIFY_HTTP_PROXY || |
Contributor
There was a problem hiding this comment.
same suggestion about explicit checks here (and line 347)
blittle
force-pushed
the
bl-proxy-support
branch
from
April 1, 2025 18:10
d8b85c6 to
954c254
Compare
Contributor
Author
|
/snapit |
Contributor
|
🫰✨ Thanks @blittle! Your snapshots have been published to npm. Test the snapshots by updating your "@shopify/cli-hydrogen": "0.0.0-snapshot-20250401182347",
"@shopify/hydrogen": "0.0.0-snapshot-20250401182347",
"@shopify/mini-oxygen": "0.0.0-snapshot-20250401182347"
|
blittle
force-pushed
the
bl-proxy-support
branch
from
April 3, 2025 19:16
efb1195 to
0bf3e21
Compare
Merged
juanpprieto
pushed a commit
that referenced
this pull request
Sep 17, 2025
* Add support for SHOPIFY_HTTP_PROXY for the hydrogen dev server * Add changeset * Change upgrade command to use nodekit fetch * Don't make proxy requests to localhost * Update changeset * Fix * Fix formatting
2 tasks done
frandiox
pushed a commit
that referenced
this pull request
Jun 16, 2026
* Add support for SHOPIFY_HTTP_PROXY for the hydrogen dev server * Add changeset * Change upgrade command to use nodekit fetch * Don't make proxy requests to localhost * Update changeset * Fix * Fix formatting
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.
WHY are these changes introduced?
Add support for HTTP proxies with the environment variables
SHOPIFY_HTTP_PROXYandSHOPIFY_HTTPS_PROXY. Define one of these variables before starting the Hydrogen dev server to make all requests go through a proxy serveWHAT is this pull request doing?
When starting the hydrogen server for local development, we boot the app in workerd. This allows us to execute code in an actual worker environment, mostly identical to production. Proxy support in workerd itself is not easy to configure, nor do they do not implement
ProxyAgent.Instead of relying on workerd to proxy network requests, utilize
outboundServicein miniflare to execute all network requests in a node environment. Then from that environment we utilize undici with aProxyAgent. We already useoutboundServicefor whenNODE_TLS_REJECT_UNAUTHORIZED=0.The only downsides to this approach our version of undici's fetch might slightly deviate from workerd's implementation. So there's a small chance that something that works locally, won't work in prod, or vice-versa. Also, this appears difficult to write an automated test to protect against future regressions .
HOW to test your changes?
SHOPIFY_HTTP_PROXY=http://localhost:8888 shopify hydrogen devPost-merge steps
SHOPIFY_HTTP_PROXY.Checklist