Fixing "register" case in `examples/c2s.js`

"c2s" example didn't work. I found that the "register" event is emitted by the client, not the server.