superfeedr/ejabberd-websockets — pull request #8 by theozaurus (2012-01-20 13:39:23+00:00)
Title: WIP: Changes to recognise upgrade request for RFC 6455

I've made changes so that the upgrade request is now no longer case sensitive as per the advice in https://github.com/superfeedr/ejabberd-websockets/issues/7#issuecomment-3568078.

However, Chrome 16 still does not work. Further changes are required to make this compatible with [RFC 6455](http://tools.ietf.org/html/rfc6455) ([as implemented by FF11 and Chrome 16](http://en.wikipedia.org/wiki/WebSocket#Browser_support)).

Posting this purely as work in progress, but hopefully it will help.

The logs from ejabberd now look like:

=INFO REPORT==== 2012-01-20 13:38:50 ===
ERROR: "D(~p:~p:~p) : Request data:~p:~n" - [<0.382.0>,
mod_websocket,
36,[],
{wsrequest,
[{"Sec-WebSocket-Version",
"13"},
{"Sec-Websocket-Key",
"j34gc9D6Hl6qnl0Pz7Ai+w=="},
{"Sec-WebSocket-Protocol",
"xmpp"},
{"Origin",
"null"},
{'Host',
"xmpp.local:5288"},
{'Connection',
"Upgrade"},
{'Upgrade',
"websocket"}],
undefined,
false,
'GET',
["ws-xmpp"],
#Port<0.3190>,
gen_tcp,
undefined}]

=INFO REPORT==== 2012-01-20 13:38:50 ===
D(<0.382.0>:mod_websocket:49) : Origin is valid.

=INFO REPORT==== 2012-01-20 13:38:50 ===
D(<0.382.0>:ejabberd_websocket:184) : Websocket!