In my server code, I was starting to write code to reject requests that don't pass the correct URL (in the node-ws shouldHandle(request) handler). My client was still requesting a connection to "/", which reliably triggers a crash:
angular.js:13642 TypeError: Cannot read property 'readyState' of undefined
at $WebSocket.get (angular-websocket.js:374)
at $WebSocket.send (angular-websocket.js:296)
at MessageService.send (message-service.js:45)
at m.$scope.send (conversation-directive.js:204)
at fn (eval at compile (angular.js:14539), <anonymous>:4:203)
at b (angular.js:15628)
at e (angular.js:25172)
at m.$eval (angular.js:17378)
at m.$apply (angular.js:17478)
at HTMLButtonElement.<anonymous> (angular.js:25177)
In my server code, I was starting to write code to reject requests that don't pass the correct URL (in the node-ws shouldHandle(request) handler). My client was still requesting a connection to "/", which reliably triggers a crash: