Real Time Phoenix Errata P32: wscat doesn't accept localhost

While I can load the website at either localhost:4000 or, the wscat command is only working for me when I use

So, to connect, it’s:

wscat​​ ​​-c​​ ​​'ws://'​

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 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 And maybe it’s only an issue on my setup.


Thanks for this report. I’m unsure of the specifics regarding M1 and why it may not work to resolve localhost. It’s good that you found a solution that works for your case. I could see this being addressed as a footnote / callout in case others run into issues.

Same on Tumbleweed (v 22020913), thanks for the tip!