While I can load the website at either localhost:4000
or 127.0.0.1:4000
, the wscat
command is only working for me when I use 127.0.0.1:4000
.
So, to connect, it’s:
wscat -c 'ws://127.0.0.1:4000/socket/websocket?vsn=2.0.0'
I don’t see anyone else having this issue at the wscat repository. I’m on a fresh M1 Mac using the default zsh shell. My /etc/hosts
file has the expected link between 127.0.0.1
and localhost
.
Just wanted to note this in case anyone reaching this page in the book got frustrated and didn’t think to try switching from localhost
to 127.0.0.1
. And maybe it’s only an issue on my setup.