Accept HTTP_PROXY to specify a fallback server during development
See original GitHub issueLike proxy
in package.json
could react-script start
also accept the HTTP_PROXY or HTTPS_PROXY environment variables to specify a fallback server during development?
It would be as easy as adding a few lines of code
var proxy = require(paths.appPackageJson).proxy
if (!proxy) {
proxy = process.env.HTTPS ? process.env.HTTPS_PROXY : process.env.HTTP_PROXY
}
This is useful in situations like mine where some team members don’t use dockers and others do, resulting in different proxy urls.
I’m available to create a PR if you deem this acceptable.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:20
- Comments:14 (1 by maintainers)
Top Results From Across the Web
Proxying API Requests in Development - Create React App
The development server will only attempt to send requests without text/html in its Accept header to the proxy. Conveniently, this avoids CORS ...
Read more >HTTP fallback configuration, testing and troubleshooting - IBM
The web server (Apache) must be configured as a proxy to proxy the requests that Connect client initiate. a. Configure the Apache SSL...
Read more >nginx reverse proxy with fallback - Server Fault
I need to do a 2TB S3 migration and it would simplify the process if nginx could be setup this way. Here is...
Read more >DevServer - webpack
See the development guide to get started. ... This set of options is picked up by webpack-dev-server and can be used to change...
Read more >React — How To Proxy To Backend Server - Medium
Setting up proxying into the backend server with Create React App is straight forward and easy. To tell the development server to proxy...
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 Free
Top 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
I am shocked and appalled that
HTTPS_PROXY
isn’t honored by react-scripts 👎I feel like our proxy setup is already pretty complicated and don’t want to complicate it further. IMO the workaround in https://github.com/facebookincubator/create-react-app/issues/1640#issuecomment-328475314 is reasonable, and I suggest using that approach.