-
Notifications
You must be signed in to change notification settings - Fork 9
Comet
This covers Javascript longpoll which is "deprecated" since only IE7 (0.1% of global users) requires it, use cometstream instead.
XHR | XMLHttpRequest |
---|---|
XDR1 | Cross Domain Request |
First, try either the XHR or2 XDR chat demo, it's the little black box in the bottom right corner!
If you want to chat between XDR and2 XHR chats make sure you use two different browser applications2.
To create and join a channel type /join <name>
To leave the channel type /exit
Type /list for channel listing and /color <rrggbb>
to change color.
With XDR long-poll you can add the chat widget to any page, notwithstanding of platform and domain, without serverside modifications. In a few rows of html, some images, one css and js file; you're truly minutes away from having your own industrial strength, real-time, comet chat; accessible from behind the thickest of firewalls.
Try it now: download!
Comet is all about corporate firewalls, because you want to reach everyone, everywhere, you need to use HTTP on port 80. Now you can push data over HTTP on port 80 in real-time.
Rupy enables you to connect 10000+ concurrent users with one server, this number can scale to 30000+ depending on your application.
We use long-polling for both transports because it's the most robust way to handle gateway timeouts and also the only implementation that works on all browsers without fragmenting the code (implementing different solutions for some browsers).
In web-browser context also known as 'Ajax Push', see Comet for more information.
Download the talk application and extract it. Enter the extracted talk/ folder and start rupy with either the run.bat or run.sh script depending on your OS. Then run ant in that same talk/ folder, this should build and deploy the talk.jar application to your rupy server. Lastly, browse to http://localhost:8000/talk.html and chat in real-time over HTTP!
If you want to use rupy talk with apache enable mod_proxy and add something along these lines:
<VirtualHost *:80>
ProxyPass /poll http://localhost:8000/poll
ProxyPass /broadcast http://localhost:8000/broadcast
</VirtualHost>
1 Also known as XSS or cross site scripting.
2 The session is reused for one browser type, so you need to use two different browser types (Internet Explorer, Firefox, Chrome or Safari). Also the HTTP spec. only allows clients to connect maximum two sockets per domain; so the long-poll requests will lock the browser if you try to chat between XHR tabs in the same browser type.