title: Chrome WebSocket - onopen is not a function
body: <p>I have a really simple websocket test on chrome, but it seems to be failing miserably:</p>
  
  <pre><code>var ws = new WebSocket('ws://localhost:8002/', 'a')
  
   ws.onopen(function() {
       console.log("ok")
   })
  </code></pre>
  
  <p>It tells me: <code>Uncaught TypeError: Property 'onopen' of object #&lt;WebSocket&gt; is not a function</code>. I would assume that onopen should exist as a method whether or not there is a websocket server actually running, but I do have one running on that port. </p>
  
  <p>I'm using chrome 32.0.1700. I see that all of the callback methods (onopen, onmessage, etc) are all null. What's going on here?</p>