HTTP request with & Node js version

Hi all

I posted recently regarding an issue with the HTTP request node not working with a specific url as in the following flow.

[{"id":"e529806637c41745","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"0aecaff079a7d222","type":"inject","z":"e529806637c41745","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":200,"wires":[["a912609c14464323"]]},{"id":"7c34b31725eb266f","type":"debug","z":"e529806637c41745","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":580,"y":200,"wires":[]},{"id":"a912609c14464323","type":"http request","z":"e529806637c41745","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"hc-ping.com/8ed9d26b-d62c-4fd6-999b-7a07ea0b5f8a","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"basic","senderr":false,"headers":[],"x":330,"y":200,"wires":[["7c34b31725eb266f"]]}]

I tried to resolve this with the help of others with no luck then noticed a post with a similar issue with a different url

Remedy was to downgrade node js (in this case to 18.20.8) all works OK, tried version 20.0.0 and issue returns.

Not sure if issue is with nodered, node js or the specific url’s and if I should be using a later version of node js with nodered 4 to avoid other issues.

Advice would be appreciated

Hello Wally,

Change your URL to http://hc-ping.com/8ed9d26b-d62c-4fd6-999b-7a07ea0b5f8a

you are missing the http://

Seems to work after you do that :slight_smile:

Hi

With node js 18 i can use http, https or no prefix and they all work, with node js 20 they all fail.

What version of node red are you using ?

Thanks

And which version of node js

Hi Wally,

Node-red 4.0.3

Nodejs 20.19.5

Hi
Thanks for the info.

That's odd. this is a pi 3 clean install from a week ago via the script. No other flows or nodes installed. Never works with healthchecks.io api & http node until I change to earlier nodejs version. Always works with exec node & curl. Someone else with same issue;

(Browser request works but exact same node red request fails)

Can you post a failing flow where you specify http?

nodejs 18.20.8

"_msgid":"44f241f22ef93373","statusCode":200,"headers":{"server":"nginx","date":"Tue, 16 Sep 2025 23:31:18 GMT","content-type":"text/plain; charset=utf-8","content-length":"2","access-control-allow-origin":"*","ping-body-limit":"100000","connection":"close","x-node-red-request-node":"1dc6ebc7"},"responseUrl":"https://hc-ping.com/51300254-381b-44ee-9c4e-29e01c380b3d","payload":"OK","redirectList":[],"retry":0}

nodejs 20.0.0

{"__enc__":true,"type":"error","data":{"name":"RequestError","message":"","code":"ENETUNREACH","stack":"RequestError\n    at ClientRequest.<anonymous> (file:///usr/lib/node_modules/node-red/node_modules/got/dist/source/core/index.js:790:107)\n    at Object.onceWrapper (node:events:626:26)\n    at ClientRequest.emit (node:events:523:35)\n    at TLSSocket.socketErrorListener (node:_http_client:495:9)\n    at TLSSocket.emit (node:events:511:28)\n    at emitErrorNT (node:internal/streams/destroy:151:8)\n    at emitErrorCloseNT (node:internal/streams/destroy:116:3)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)AggregateError\n    at internalConnectMultiple (node:net:1102:18)\n    at internalConnectMultiple (node:net:1160:5)\n    at internalConnectMultiple (node:net:1160:5)\n    at internalConnectMultiple (node:net:1160:5)\n    at internalConnectMultiple (node:net:1160:5)\n    at Timeout.internalConnectMultipleTimeout (node:net:1637:3)\n    at listOnTimeout (node:internal/timers:575:11)\n    at process.processTimers (node:internal/timers:514:7)"}}
[{"id":"e529806637c41745","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"0aecaff079a7d222","type":"inject","z":"e529806637c41745","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":200,"wires":[["a912609c14464323"]]},{"id":"7c34b31725eb266f","type":"debug","z":"e529806637c41745","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":580,"y":200,"wires":[]},{"id":"a912609c14464323","type":"http request","z":"e529806637c41745","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://hc-ping.com/51300254-381b-44ee-9c4e-29e01c380b3d","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"basic","senderr":false,"headers":[],"x":330,"y":200,"wires":[["7c34b31725eb266f"]]}]

I did try extending the timeout but no effect. ping returns average 321
thanks

Well your flow is ok for me on nodejs 22 with node red 4.1.0

What version of node-red are you using?

Hi Colin

node red 4.1.0 and I installed nodejs 22 but with the same result. The only difference I can see seems to be location I am in NZ and I assume you are in the UK/Europe, I changed from a rural broadband cellular connection to Starlink and it returns OK 200. Maybe timezone/server issue ? Easy to work around with exec/curl so will not spend anymore time on it but found it quite intriguing. If there is anyone in NZ using a Spark or Vodafone etc. with a cellular broadband connection could they try the flow !
Great forum, thanks for the support.

1 Like

I'm not in NZ but I do use cellular broadband and the flow returns statusCode 200.

~ $ node-red --version
Node-RED v4.1.0
Node.js v22.17.0
Linux 6.12.25+rpt-rpi-v8 arm64 LE