Green Fire Green Fire - 6 months ago 72
Javascript Question

Syntax error on new WebSocket in edge, internet explorer

So I think I am getting crazy.

I use javaScript to make a WebSocket connection on port 443.

The problem is that the WebSocket declaration is throwing a SyntaxError only on edge and internet explorer browsers, on other browsers like Chrome and Firefox it works perfectly.

The code that I use:

var Connection;
Connection = new WebSocket("ws:/");

Console Edge Error
Critical Code In Edge

Does someone knows what am I doing wrong?


change it to:

var connection = new WebSocket("ws://");