title: TypeError: ws.onopen is not a function in stomp-node.js
body: <p>I need to use nodejs to run a stomp client for javascript and send stomp message over websocket.</p>
  
  <p>I have a js file send.js:</p>
  
  <pre><code>var Stomp = require('stompjs');
  var client = Stomp.overWS('ws://localhost:61614');
  </code></pre>
  
  <p>I ran <code>node send.js</code> in command line but got below errors:</p>
  
  <blockquote>
    <p>/xxx/node_modules/stompjs/lib/stomp-node.js:71
          ws.onopen();
         ^
    TypeError: ws.onopen is not a function
        at WebSocketClient. (/xxx/node_modules/stompjs/lib/stomp-node.js:71:10)
        at WebSocketClient.emit (events.js:180:13)
        at WebSocketClient.succeedHandshake (/xxx/node_modules/websocket/lib/WebSocketClient.js:335:10)
        at WebSocketClient.validateHandshake (/xxx/node_modules/websocket/lib/WebSocketClient.js:319:10)
        at ClientRequest.handleRequestUpgrade (/xxx/node_modules/websocket/lib/WebSocketClient.js:248:14)
        at ClientRequest.emit (events.js:180:13)
        at Socket.socketOnData (_http_client.js:476:11)
        at Socket.emit (events.js:180:13)
        at addChunk (_stream_readable.js:269:12)
        at readableAddChunk (_stream_readable.js:256:11)</p>
  </blockquote>
  
  <p>Why? How can I correct this? </p>