Green Fire Green Fire - 7 months ago 102
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:/127.0.0.1:443");


Console Edge Error
Critical Code In Edge

Does someone knows what am I doing wrong?

Answer

change it to:

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