igm/sockjs-go — pull request #3 by gthomas (2013-05-31 20:41:19+00:00)
Title: Multiplexing/Channels

Hello,
I wrote a multiplexing implementation that works with the multiplexing client here:
https://github.com/sockjs/websocket-multiplex/blob/master/multiplex_client.js
usage example:
```go
mux = sockjs.NewMultiplexer(func(conn sockjs.Conn, msg string) {
conn.WriteMessage([]byte(msg))
})
channel := sockjs.NewChannel("composite", onConnectComposite, onCloseComposite, onDataComposite)
composite_channel = channel
mux.RegisterChannel(channel)

sockjs.Install("/composite", func(conn sockjs.Conn) { mux.Handle(conn) }, sockjs.DefaultConfig)
```