Fixing "register" case in `examples/server-and-client.js`.

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