abourget/gevent-socketio — pull request #148 by lazerscience (2013-06-11 14:38:02+00:00)
Title: Fixing forced XHR disconnect

As far as i can see [forced disconnect requests](https://github.com/LearnBoost/socket.io-spec#forced-socket-disconnection) aren't really handled anywhere in gevent-socketio. You can send them eg. when closing a browser window when using socket.io's `sync disconnect on unload`.

The url for that request has changed in socket.io > 0.9.8 to some obscure format containing a double slash: https://github.com/LearnBoost/socket.io-client/blob/0.9.16/lib/socket.js#L361

Without the fix gevent-socketio is handling the request like a "normal request" but can't get the socket correctly as it doesn't know how to handle the URL correctly and causes a `KeyError` as a result of this...

I've also updated the `socket.io.js` coming with the tests to 0.9.16 as it works for me and all js tests pass.