views:

196

answers:

2

Pretty much the opposite of server-side push, also known as Comet. I'm wondering if it is possible to use long lived HTTP connections to push information to the server.

Unlike a simple XHR, the connection would be kept alive and data would be streamed to the server at intervals, as the user completes actions etc.

Using standard technologies I don't believe this is possible, but I'm open to suggestions on possible exploitations or ingenious ways of accomplishing this. The purpose would be to complete low-latency data pushes to the server for fast and efficient one-directional streaming.

I'm not interested in using socket implementations with flash/java bridges because of the hassle of serving cross domain policies or getting the java signed. Crude hacks that work without additional dependencies are welcome. Preferably the solution would be done with javascript.

+1  A: 

This can be done in one of a few ways ...

You can keep a connection open and do POST's, or I am sure it is possible to do a multi-part POST.

Nippysaurus
No, definitely not the same in any way.
Ian Elliott
The question is about sending some data, then sending some more data without beginning a new HTTP request -- ie. not just normal POSTs.
Jonathan
you can keep the connection open though, and is it possible to do a multi-part GET request? Either of those two scenarios would work just fine.
Nippysaurus
How? This is in JavaScript, so manually managing a socket is out.
John Kugelman
Its harder to do, but its not impossible.
Nippysaurus
+1  A: 

I once saw a talk by the guy behind http://orbited.org/

It's a js library that uses standard technology to keep a connection open between the server and the client you can push stuff down.

James
Definitely along the lines of what I'm looking for, although would be much better if it would work over standard port 80.
Ian Elliott
It's a abstracted connection, though, that can end up using multiple HTTP requests (as many as one per message). But it can be run on port 80 (just not, of course, on the same IP as a web server).
Miles