Skip to content

connection refused and host: 0.0.0.0 #5334

Closed Answered by metcoder95
AmosSzust asked this question in Q&A
Discussion options

You must be logged in to vote

👋
I'm not sure what you refer to with security exactly, maybe you can elaborate more on that?

About why your change worked, basically fastify listens to localhost by default when no host has been set; it automatically will attach to the different IPs your local hostnames has while resolving localhost (usually will do dual listen to IPv6 and IPv4 loopback addresses).
By changing to 0.0.0.0 you are setting fastify to listen to all possible network interfaces within the machine.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by Fdawgs
Comment options

You must be logged in to vote
1 reply
@jsumners
Comment options

Comment options

You must be logged in to vote
1 reply
@jsumners
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants