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.