Basic http endpoint ECONNREFUSED problem

I've used the Node-Red http request on many occasions with no problems but have only just started trying to set up an http endpoint. I'm falling at the first hurdle and have no idea why.

  • It's all local to one Ubuntu machine

  • I have an http-in node connected directly to an http-out node (at this stage it's not doing anything useful). It's set up as /myserver using GET

  • I then have an http request node pointed at (all variations on the theme of) http://127.0.0.1/myserver also set to GET and with no authentication settings.

When I run the request I get an ECONNREFUSED error. Running node-red in verbose mode gives the following in the console:

[error] [http request:b7cb3ad3.58be5] Error: connect ECONNREFUSED 127.0.0.1:80
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)

Also if I use the simple hello world template here https://cookbook.nodered.org/http/create-an-http-endpoint and try get a response from a browser, it again refuses to connect.

I've done a fresh node-red install and all of the security parts of settings.js remain commented out, although it does look like a security problem. Also restarted my router, but as I'm using localhost that shouldn't make any difference. Any ideas?

Are you running node-red on port 80? If you are then this might be because ports under 1024 are protected

Normally (by default) node-red runs on port 1880

Have you tried accessing http://127.0.0.1:1880/myserver

Thanks Steve, you are a genius my friend. Or maybe I was just being thick. Either way, works perfectly.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.