Looking at your link it seems to me that all pub/sub work is done by Nginx, Ruby code is used only to test it and send messages. Clients are still using long polling:
In the script above, every five seconds a publisher emits a new event to our Nginx server, which in turn, pushes the data to two subscribers which have long-polling connections open and are waiting for data. Once the message is sent to each subscriber, Nginx closes their connections and the clients then immediately re-establish them to wait for the next available message.
Nginx serves as simple retranslator for messages (very clever setup BTW, thanks for the link).
To put it short: browsers aren't capable for this sort of connection you trying to do. This is what WebSockets were invented for.
Later i'll make some code in Node.js to use this setup with Nginx (I'm interested in it too).