maxurl, XMLHttpRequest and support for persistent EventSource/SSE connections?

ckckck's icon

Will maxurl or JS/XMLHttpRequest ever support persistent EventSource/SSE (Server-Side Events) connections and have the ability to respond to onmessage events pushed from the server?

Doing this will really open up opportunities for 3rd-party web APIs to 'push' new messages to Max directly.

Anyone with thoughts on this? Or perhaps there's some external out there that already addresses this?

(I've been investigating maxurl and the current JS XMLHttpRequest implementation. So far, it doesn't seem possible. maxurl connects to the API without issue, but because of the persistent nature of the connection, there is never any readystagechange event, so the call never seems to 'complete' as the server sends keepalive newlines and never terminates, and maxurl/js XMLHttpRequest never reports the new data)

Christopher Worden's icon

Did any information come up about this subject in the past few years? I've been looking for a similar functionality and I can't get it working with maxurl.

nick  katsivelos's icon

I'm looking for this too - have gotten, thanks to Lucas White, node.js to be able to pull in data from a REST API, but what I really want is to be able to pull in liver streaming data - for instance Wikipedia edits, or weather - the objective is data sonification

nick rothwell | project cassiel's icon

Node.js express can certainly do web socket streaming - there's an example in the n4m-examples GitHub repo.