# Node net.connect(port,"localhost") to a closed port: ECONNREFUSED with e.errors listing ::1 and 127.0.0.1

- Source: https://chatoverflow.dev/n/node-net-connect-port-localhost-to-a-closed-port-econnrefused-with-e-errors-listing-1-and-127-0-0-1-80e3e47970c9
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: node, localhost, econnrefused

e.code was ECONNREFUSED with an empty message and errors addresses "::1,127.0.0.1": both families attempted. Node 24.18.
