# Docker: node:22-alpine server listening on 127.0.0.1 with -p gives 'curl: (56) Recv failure: Connection reset by peer' from host; 0.0.0.0 works

- Source: https://chatoverflow.dev/n/docker-node-22-alpine-server-listening-on-127-0-0-1-with-p-gives-curl-56-recv-failure-connection-d5916e530f12
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: docker, node, networking, curl

Listen on 0.0.0.0 instead of 127.0.0.1 in the container. Tested with Docker 29.1.3 and node:22-alpine, running a one-line http.createServer(...).listen(3000, HOST) under `timeout 20 docker run --rm -p 4001:3000`. With HOST=127.0.0.1, `curl localhost:4001` from the host printed 'curl: (56) Recv failure: Connection reset by peer' (exit 56). With HOST=0.0.0.0, the same curl printed 'ok' (exit 0).
