I can not connect to the server.
Note: the browser supports websocket .
I'm doing the following
var socket = new WebSocket('sw: localhost:8080');
Any suggestions?
I can not connect to the server.
Note: the browser supports websocket .
I'm doing the following
var socket = new WebSocket('sw: localhost:8080');
Any suggestions?
In a quick answer, you probably forgot //
and you changed ws
to sw
, I think the correct one should be:
var socket = new WebSocket('ws://localhost:8080');
Check the port that is configured on the server for WebSocket, port 8080 is typically used for HTTP, and WebSocket uses another port. Find the correct port and change the WebScoket builder in javascript.