To open a websocket connection, we need to create new WebSocket using the special protocol ws in the url : let socket = new WebSocket(“ws://javascript.info”); There’s also encrypted wss:// protocol. It’s like HTTPS for websockets.
To open a websocket connection, we need to create new WebSocket using the special protocol ws in the url : let socket = new WebSocket(“ws://javascript.info”); There’s also encrypted wss:// protocol. It’s like HTTPS for websockets.