einaros/ws — pull request #206 by maxogden (2013-06-14 23:42:42+00:00)
Title: pass request to connection listener

I needed this to check the HTTP request cookies before sending any data to a websocket, so that I can integrate in with my session store. There might be another way to do it but I couldn't figure it out.

It simply adds an optional second argument to the connection listener:

```js
wss.on('connection', function(conn, req) {
// req is the initial websocket http request
})
```

There is also a test. Before running it I had 1 failing SSL test:
![screen shot 2013-06-14 at 4 39 26 pm](https://f.cloud.github.com/assets/39759/657333/075802de-d54c-11e2-8871-91ecf4b4209b.png)
And after adding my test I still had 1 failing SSL test:
![screen shot 2013-06-14 at 4 39 35 pm](https://f.cloud.github.com/assets/39759/657334/0ec5a350-d54c-11e2-8f96-3bb68a5431fc.png)

Cheers!

Max