ECONNRESET proxy error between dev server and API - node.js

When I run my development server, I get the following error.
Proxy error: Could not proxy request /graphql from localhost:3000 to http://localhost:3010.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNRESET).
It is preventing me from proxying any requests from the development server to the API.
After debugging, I realized it was not a problem with the code because my colleague and I are working from the same repo and he does not have this error. Also, sometimes if I restart my terminal the error will go away before it comes back again.
Would greatly appreciate guidance on what is the root of this issue and how I can resolve it.

What I discovered, and what seems to have solved the problem, is that I was running too many different servers on ports that were too close together. My servers were running on port 3000, 3010, and 3009. I noticed that whenever the server at 3009 was running, I would get the above error. When I changed the port for that server from 3009 to 9999, all proxy errors ceased.

Related

Proxy error: Could not proxy request /api/register from localhost:3000 to http://localhost:8000/ (ECONNREFUSED)

I have a React frontend that uses jwt to authenticate with the laravel backend. The backend works and is connecting just fine using laravel views, but when I try to proxy a request from React, it gives me a Connection Refused error.
Proxy error: Could not proxy request /api/register from localhost:3000
to http://localhost:8000/ (ECONNREFUSED).
Connecting to http://localhost:8000/api/register works normally. And sending a POST request with Axios also works normally and returns the token json. But when I proxy it with node, it doesn't work.
in my package.json code is
"proxy": "http://localhost:8000",
Please anyone help me. how to fixed it?
I think you should add "/" after the port number in package.json file
"proxy": "http://localhost:8000/"
Please check these points and solve your problem:
Please check your ip of backend server.(https://127.0.0.1:3000 or http://127.0.0.1:3000)
Please check your backend server is running or stop if stopped then start ypur server.
Please check protocol http or https used in your backend server.(https or http)
I hope with the help of these points you can solved your problem which is facing by you.
You need to run both of the local host (3000 and 8000) in different terminal. For example, run the backend server in os(windows's) command prompt cmd and frontend server in vscode terminal.

Vue application running on Digitalocean times out in browser

First time I try to use a node.js droplet on Digitalocean: I have a vue.js application running on port 8080, but it times out when I try to load the masterpiece in the browser (I don't have a domain so I use the [server IP]:8080 to access it).
I made sure 8080 is open in the firewall (ufw):
Netstat -pln gave the result seen in the screenshot below, a node program is running but nothing is named vue in case that would be required:
Tried export HOST=0.0.0.0 on advice from a friend, but didn't seem to do anything.
Tested curl 127.0.0.1:8080 from the digitalocean console and it works correctly.
The browser error message is err _ connection timed out.
Any tips on how to get this to show in the browser? As I'm not experienced in working with servers please give me step by step instructions. Thanks!

Unable to access node server running on specific port from other machine

I am running node server running react application.server is run by webpack. Server is running on 10.121.45.23:3005. I tried opening the application on other machine but page displays connection timed out. I have tried following things to resolve the issue, but nothing helped.
ping 10.121.45.23 from another machine. It is successful.
On server, netstat -ano. I am able to see 10.121.45.23:3005 listening. No loopback address was there as mentioned in many answers on Stack Overflow.
On another machine,telnet 10.121.45.23 3005. It fails and say cannot connect on port 3005. Telnet to some other port on which java is running, is successful. It fails only for node.js server.
So my problems are:
telnet is not working to that port.
Not able to open application on other machine's browser.
Am I missing any checks?
Sounds like you've tested quiet a bit. Have you tried another port, just in case there's a firewall or something?
Also, try explicitly telling webpack to listen on the all-hosts address 0.0.0.0
webpack-dev-server --port 9000 --host 0.0.0.0

localhost:3000 connection refused after app.js is set (Windows 7)

I've followed this manual of installing MEAN stack https://thecodebarbarian.wordpress.com/2013/07/22/introduction-to-the-mean-stack-part-one-setting-up-your-tools/
and I got stuck on the point where I should be able reach for localhost:3000 successfully, but instead I get ERR_CONNECTION_REFUSED. I checked the ports using
netstat -an
and it seems my port 3000 is not even open. My Apache is working on port 80 and after reaching for localhost:80 everything works fine (I even checked if closing the Apache helps). The only thing I changed in the manual is that I installed both express and express-generator thanks to this install express with npm.
Can anybody tell me what should I do additionally so my port 3000 responds?
EDIT: I also checked the host files in system32, the only localhost address I have is 127.0.0.1 (three times, though!)
EDIT2: Solved, same issue as here: Express Node.js doesn't work
Remember to change the app.js file in the folder you are currently working in!

Getting "The connection to 'localhost' failed" error when trying to browse localhost site on IIS

My localhost IIS sites recently stopped working and I can't figure out why. If I try and browse to http://localhost after a while I get the error Oops! Google Chrome could not connect to localhost. If I open Fiddler and try again I get a 502 error that states System.Net.Sockets.SocketException A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 127.0.0.1:80
I've tried using netstat -a -b to see if any other applications are blocking port 80, but there doesn't appear to be anything obvious.
I've disabled proxy servers and that doesn't have any affect.
As a last resort I even tried re-installing IIS
Everything has been working fine and I can't think of any configuration changes that would've stopped localhost from working. Any ideas?

Resources