For some reason the test connection in Weasel is not working for me. I keep getting "The Connection is Abruptly Closed or Couldn't be Opened ! CONNECTION CLOSED!" Does the URL and the protocol need to have WS in it? Or just the URL? Right now I have URL: ws://localhost:3001 and protocol: ws.
Protocol is optional, it's only needed if you are taking decisions on the server based on it's value.
Can you try connecting to wss://echo.websocket.org, it's an echo server and would return the messages posted to it. If this works, then the issue is on your localhost websocket server setup. websocket.org/echo.html
I didn't get it at first, but after staring at it for a while I think the reason is using app.listen(port) instead of server.listen(port);
Never realised before but found a good post about it at StackOverflow
I still have some cleaning up to do on the code, here's what I've done till now on server
For some reason the test connection in Weasel is not working for me. I keep getting "The Connection is Abruptly Closed or Couldn't be Opened ! CONNECTION CLOSED!" Does the URL and the protocol need to have WS in it? Or just the URL? Right now I have URL: ws://localhost:3001 and protocol: ws.
Protocol is optional, it's only needed if you are taking decisions on the server based on it's value.
Can you try connecting to wss://echo.websocket.org, it's an echo server and would return the messages posted to it. If this works, then the issue is on your localhost websocket server setup.
websocket.org/echo.html
Yeah, connecting to that URL works fine. I'll wait for the fifth article and compare my code to your's.
Maybe you can see something wrong. This is main file that kicks off the server. dev-to-uploads.s3.amazonaws.com/i/...
I didn't get it at first, but after staring at it for a while I think the reason is using
app.listen(port)
instead ofserver.listen(port);
Never realised before but found a good post about it at StackOverflow
I still have some cleaning up to do on the code, here's what I've done till now on server
That was definitely the issue! Thank you so much!
This server does not respond. FYI