-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proxy defined via package.json is slow #4086
Comments
We are forced to use react-app-rewired for custom agent. It's sad that we were not able to set our custom agent for
I guess it's workaround and potentially not supported in the future releases of
|
Nice note @yyfearth !. Didn't know about |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue. |
We have proxy defined in
package.json
in our react application and We use proxy between front-end (webpack) and back-end (express) during development as described here.package.json
:So as you can see it's simple proxy as described in documentation.
On the backend side (port
3001
) we call another APIs (another rest services).I have noticed that proxy calls from webpack (create-react-app) to express (backed) during development are really slow. (we work on Windows OS)
As you can see the time differences between proxy calls (port 3000) and direct calls - port (3001) - are really huge. I expected delay but this looks weird.
Also sometimes large JSON response (
~38KB
) from proxy is broken (invalid - e.g missing some parts of a response or swapped characters). I have been struggling with the same issue on backend side and I think I have resolved it with proxy-agent where I setkeep-alive
connection.Do you have any idea why or how to improve proxy time and behavior?
Also I tried to set agent in
package.json
but without success.create react app documentation says:
And http-proxy documentation says
Is it possible to define agent in
package.json
?I tried but I got following error
Highly appreciate any suggestion or idea.
The text was updated successfully, but these errors were encountered: