Green Fire Green Fire - 1 year ago 409
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?

Answer Source

change it to:

var connection = new WebSocket("ws://");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download