I tried to do that same thing and failed, because the C2 requires there to be a browser on the server to serve as the host "peer", since C2 Multiplayer is P2P architecture.
So, long story short, it won't work. We are using AJAX now, until I have time to program a WebSocket plugin with a programmable API.
Company name changed to avoid Facebook-type shenanigans
"Someone once told me I bite off more than I can chew...
I told them I would rather choke on greatness than nibble on mediocrity."