ServeHTTP:websocket: could not find connection header with token 'upgrade'
Closed this issue · 2 comments
The sever compiled from chapter 1 quits with the error:
ServeHTTP:websocket: could not find connection header with token 'upgrade'
when run as root on port 80, after a user on a different network connects to it. The server is run with the command:
sudo ./chat -addr=":80"
and the server runs fine, works with clients connecting from within the network, but crashes with that error when a client connects from another network..
I assume this is a configuration issue -- some trouble upgrading from http to websocket, but what is causing the problem?
see #26 - it's out of scope of the book, but it looks like people have solved it in various ways.
Just a heads up, this appears to be an issue if you try accessing the URL without the trailing slash. Use http://localhost:3000/room/ and the program doesn't crash.