title: How do I verify origin url on einaros' ws websocket package
body: <p>I've tired the code below it isn't worked:</p>
  
  <pre><code>var WebSocketServer = require('ws').Server;
  var wsServer = new WebSocketServer({port: 8080});
  
  wsServer.on('connection', function(ws) {   
      if (ws.origin != 'http://example.com') {
          console.log('Origin was not http://example.com');
          return;
      }
  });
  </code></pre>
  
  <p>This code is working fine with worlize's websocket server package. But I prefer einaros' better.
  However, when I investigate ws.property, it contains something like below:</p>
  
  <pre><code>headers: {
      ...
      origin: 'http://example.com'
      ...
  },
  </code></pre>
  
  <p>So how do I verify the origin of browser request.</p>
  
  <p>Thank you,</p>