--goofup101
Content-type: text/xml
--goofup101--
On the browser side, we need to be able to process each part without waiting for the complete multipart message to arrive. This can be done via the onload handler of XMLHttpRequest. Here is an example. The onload handler in this example gets called whenever a new chat message arrives.
var channel = ...; // Create XMLHttpRequest
channel.multipart = true;
channel.onload = function(e)
{
var message;
if(this.responseXML) {
message = this.responseXML;
}
else {
message = this.event.target.responseXML;
}
// Process the message
};
...
channel.open('GET', url, true);
channel.send(null);
...
These are the easier problems to solve. For the server push to work effeciently and effectively, managing connections is critical for both the browser and the server