最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - ReactJS could not proxy request from localhost:3000 to localhost:3003 - Stack Overflow

programmeradmin10浏览0评论

I am writing a SPA using create-react-app and am using an expressjs server as my backend. For development I run my frontend test server on port 3000 and my backend expressjs test server on 3003.

I make many API calls client side using Axios so for development convenience I have defined proxy: "http://localhost:3003" in my package.json

This works fine on my laptop, but when running on my workstation I constantly get the error when accessing my app:

Proxy error: Could not proxy request /sockjs-node/487/wrst1bub/websocket from localhost:3000 to http://localhost:3003/. See .html#errors_mon_system_errors for more information (ECONNRESET).

I have no idea where this is ing from and I do not use sockjs in any capacity as far as I know. This is a console error and it does not crash my app but it is very annoying and I would like to get rid of it. Any help is greatly appreciated.

I am writing a SPA using create-react-app and am using an expressjs server as my backend. For development I run my frontend test server on port 3000 and my backend expressjs test server on 3003.

I make many API calls client side using Axios so for development convenience I have defined proxy: "http://localhost:3003" in my package.json

This works fine on my laptop, but when running on my workstation I constantly get the error when accessing my app:

Proxy error: Could not proxy request /sockjs-node/487/wrst1bub/websocket from localhost:3000 to http://localhost:3003/. See https://nodejs/api/errors.html#errors_mon_system_errors for more information (ECONNRESET).

I have no idea where this is ing from and I do not use sockjs in any capacity as far as I know. This is a console error and it does not crash my app but it is very annoying and I would like to get rid of it. Any help is greatly appreciated.

Share Improve this question asked Apr 2, 2019 at 20:17 slugzslugz 1371 silver badge12 bronze badges 2
  • Setting the proxy on the package.json did not work on an app I was developing. I configured the proxy myself and it did. Here's how: facebook.github.io/create-react-app/docs/… – tutiplain Commented May 1, 2019 at 18:07
  • I also had problems when using Firefox on one machine in particular: all my requests had error 405. Switching to another browser solved that for me. Hope this helps. – tutiplain Commented May 1, 2019 at 18:08
Add a ment  | 

1 Answer 1

Reset to default 3

In my case, I was using Firefox and for some reasons, it gives me the same error. I tried to use Chrome and it worked!

发布评论

评论列表(0)

  1. 暂无评论