From what I understand, PubNub provides servers around the world who take care of the heavy lifting and all you have to do is deal with publishing / subscribing messages.
So there are servers, you just don't run any yourself and it is all abstracted away by their API.
What they did, in this case, is mock the WebSocket interface (so that they didn't need to rewrite the whole original app) and make it use the PubNub API internally. See https://github.com/pubnub/pubnub-xkcd/blob/master/websocket....