Establish a web socket connection
suggest changenew WebSocket starts the connection and returns immediately. Listen for open, message, and error. Use wss:// on an HTTPS page. ws:// is unencrypted.
const wsHost = "wss://my-sites-url.com/path/to/web-socket-handler";
const ws = new WebSocket(wsHost);
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents