jaspervdj/websockets — Issue #6: Automatic detection of protocol version
Author: boothead
Created: 2011-11-10 06:07:38+00:00
State: open

Hi,

From the example it would seem that you need to specify the version of the spec that you accept:

```haskell
type Client = (Text, WS.Sink WS.Hybi00)
```

How about dispatching to the correct one based on the headers. I've taken this approach in my stargate (python) websockets library here and it seems to work quite nicely. [See here](https://github.com/boothead/stargate/blob/master/stargate/handshake.py#L26)

This will become less of an issue as browsers upgrade and stop supporting the old insecure version of the spec I suppose, but it could be a useful shim in the mean time.

Ben