Subject: [hybi] libwebsockets very pre-alpha x-google-mux implementation

From: "Andy Green (林安廸)" <[email-masked]>
Date: Mon, 23 May 2011 10:09:42 +0100

Hi -

If you like or need to live on the bleeding edge, you might be 
interested in the very very pre-alpha x-google-mux support I just committed.

http://git.warmcat.com/cgi-bin/cgit/libwebsockets/commit/?id=a41314f3bf6c6f827c7af95dc17431be5b5fa711

1) To enable it, reconfigure with --enable-x-google-mux

2) It conflicts with deflate-stream, use the -u switch on
    the test client to disable deflate-stream

3) It deviates from the google standard by sending full
    headers in the addchannel subcommand rather than just
    changed ones from original connect

4) Quota is not implemented yet

5) Close of subchannel is not really implemented yet

6) Google opcode 0xf is changed to 0x7 to account for
    v7 protocol changes to opcode layout

However despite those caveats, in fact it can run the test client 
reliably over one socket (both dumb-increment and lws-mirror-protocol), 
you can open a browser on the same test server too and see the circles, etc.

It's obviously not ready for primetime but since I found implementing it 
so very difficult I guess it can already be quite interesting for other 
people looking to implement.

It manages to keep almost all the mux-specific stuff in 
lib/extension-x-google-mux.c / .h but to do that, it has to add a 
variety of generic extension callbacks all over the place.  Most of the 
churn in the other main files is just breaking out existing code into 
functions that the extension can use from a different context.

I particularly draw peoples' attention again to the code around 
"candidate_children_list", I believe this architecture is required for 
mux to work at all.

Patches welcome!

-Andy