Simplify our "advanced" proxy
See original GitHub issueI think we made a mistake when we added advanced proxy configuration in 1.x.
It’s poor DX imo, and has caused numerous issues (I’m too lazy to search for them 😝). I mean look at this monstrosity. Yuck!
Note: this is not an attack against the contributor of this change. We are very grateful for the contribution and it has served us well. 😄
I propose we support the simplest of configurations:
- Our default, simple behavior which works for many cases:
"proxy": "http://localhost:4000",
- An advanced case, which uses globs and proxies in 100% of cases (no heuristic):
or"proxy": [ { "match": ["api/**/*", "!api/ws/*"], "target": "http://localhost:4000" }, { "match": "api/ws/*", "target": "ws://localhost:4000" }, { "match": "api2/**/*", "target": "http://localhost:4001" } ]
"proxy": [ [["api/**/*", "!api/ws/*"], "http://localhost:4000"], ["api/ws/*", "ws://localhost:4000"], ["api2/**/*", "http://localhost:4001"] ]
In the “advanced” case, we don’t need to set ssl
– check for https://
over http://
. We don’t need to set ws
, check for ws://
; etc.
Other features (e.g. url rewrites) should never happen at the client layer because this doesn’t translate to production (it’s leaky domain logic).
Thoughts?
We can add some code to auto-migrate old usage and remove it in v3.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:24 (9 by maintainers)
Top Results From Across the Web
How to Solve Proxy Error Codes - The Ultimate Guide!
The easiest way to solve these proxy error codes is by using a proxy manager. A proxy manager is often a free and...
Read more >Verify the Proxy Settings are Correct on a Computer
Click the Advanced button; Click the Proxies tab; Select the box Auto Proxy Discovery; Click OK; Click Apply. These settings will help ensure...
Read more >Simplify Proxy Voting from Start to Finish for Corporate Issuer
Simplify Proxy Voting from Start to Finish. Leverage a unified platform and automated workflows for confidence in every proxy vote execution.
Read more >Proxy for ActiveGate | Dynatrace Docs
Advanced proxy configuration scenarios for ActiveGate · ActiveGate proxy for Kubernetes, CloudFoundry, and private Synthetic Monitoring · Different proxies for ...
Read more >IBM Sterling Secure Proxy - Overview
Includes proxy support and functions to improve security of edge-based file exchanges. Dynamic routing. Provides advanced routing to simplify infrastructure ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Timer, the new approach looks good but I have one request based on issues we’ve run into with our team. It would be helpful if the
target
value could be configurable outside ofpackage.json
.In our environment, developers can test against the back-end running locally, or against a VM, or against a cloud server. So they modify their
package.json
accordingly, which gets accidentally checked it, which leads to conflicts, etc.One solution might be to support environment variables in the target, for example:
Thanks!
@gaearon asked me to continue #3204 on this issue. To summarize:
package.json
.package.json
is usually (maybe always) under source control.