title: onopen not responding in angular websocket
body: <p>I'm new to websockets and i'm simply trying to get the server to respond when opening my app in the browser, but the <code>connection.onopen</code> is not responding as expected. Thanks for any help you can provide.</p>
  
  <pre><code>angular.module('app')
  .run(function ($rootScope) {
      var url = 'ws://localhost:3000'
      var connection = new WebSocket(url)
  
      connection.onopen = function () {
          console.log('WebSocket connected')
      }
  })
  </code></pre>