The issue lies in the fact that the WebSocket constructor is being called as a function, rather than being invoked with the new keyword. This is causing the error "Uncaught TypeError: Failed to construct 'WebSocket': Please use the 'new' operator, this DOM object constructor cannot be called as a function."
To fix this issue, the WebSocket.call(this, "wss://ws.achex.ca/") line should be replaced with WebSocket.apply(this, ["wss://ws.achex.ca/"]) or, better yet, the WebConnect function should be defined as a class that extends WebSocket using the class syntax.