[web-devel] A WebSocket library
greg at gregweber.info
Thu Oct 6 00:09:21 CEST 2011
Michael just implemented websockets with a simple demo that you can run. He
posted a basic explanation here, and we have instructions to run the demo:
On Tue, Sep 27, 2011 at 10:34 AM, Jeremy Shaw <jeremy at n-heptane.com> wrote:
> Happstack will be migrating to warp/wai really soon now. So, that should
> make happstack support trivial.
> - jeremy
>  One of the many reasons for migrating Happstack to warp is to get
> things like this for 'free'.
> On Sep 25, 2011, at 9:46 AM, Jasper Van der Jeugt wrote:
> Hello all,
>> I have been working on a WebSocket  library lately, which you can find
>> . It's getting to the point at which I want to release it on Hackage.
>> However, there is one thing remaining before the library will be really
>> for applications: integration.
>> I would like to provide integration with Happstack, Snap and Yesod -- this
>> why I have built the library around the enumerator package . It would
>> awesome if frameworks could more or less agree on a way in which an HTTP
>> connection can be "transformed" to a WebSocket.
>> That way, I will be able to provide packages such as `websockets-warp`,
>> `websockets-snap` etc.
>> Currently, the "entry point" of the websockets library is the following
>> runWebSockets :: WebSockets a
>> -> Enumerator ByteString IO a
>> -> Iteratee ByteString IO ()
>> -> Iteratee ByteString IO a
>> Where the first argument is the user-supplied code in the `WebSockets`
>> (needs to keep a bit of state etc.), the second argument is an enumerator
>> the library can use to read from the socket, and the last argument is an
>> iteratee with which the library can write to the socket.
>> A web server then needs to provide some way to get this
>> pair, and hand it over to the library (currently, this is lacking). Some
>> details apply, e.g. the web server shouldn't kill the websocket handler as
>> as regular HTTP connections.
>> Is this proposal somewhat agreeable? I'm open to any feedback.
>> : http://en.wikipedia.org/wiki/**WebSocket<http://en.wikipedia.org/wiki/WebSocket>
>> : http://github.com/jaspervdj/**websockets<http://github.com/jaspervdj/websockets>
>> : http://hackage.haskell.org/**package/enumerator<http://hackage.haskell.org/package/enumerator>
>> web-devel mailing list
>> web-devel at haskell.org
> web-devel mailing list
> web-devel at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the web-devel