This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23693 - Describe the EventSource protocol for use by non-Web clients
Summary: Describe the EventSource protocol for use by non-Web clients
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-31 17:19 UTC by contributor
Modified: 2014-02-08 00:31 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2013-10-31 17:19:46 UTC
Specification: http://www.w3.org/TR/eventsource/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top
Referrer: 

Comment:
This spec is very platform (Javascript, DOM, web browser, etc) specific. While
useful, it would also be helpful if it was more agnostic and just talked about
the wire level protocol, pushing example implementations elsewhere. Without
getting too specific, event-source is being used in embedded environments that
do not involve commodity web browsers.

Posted from: 130.76.32.78
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36
Comment 1 Ian 'Hixie' Hickson 2013-10-31 19:16:49 UTC
If you're not using a Web browser, there's really no reason to use this format. It's a trivial format. You're much better off defining your own format that does what you need, rather than trying to piggy-back on this Web-specific format.
Comment 2 Chuck Wolber 2013-10-31 22:46:50 UTC
This particular situation arose out of the limitations of the mobile application lifecycle. A certain web service only supplies current data via Server-Sent Events. You miss out on data that happened before the app was started or while the app was in the background (in the case of apps that do not run in the background). 

To get around this, a caching server can be made available that reads the same data from the web service in real time, and plays back temporal sequences to a client that needs to play catchup. The caching server would need to act in a similar manner to a web browser, reading eventsource data.

Upon waking up (or being launched), the app can ask the caching server what it missed, and then get current information from the original web service. 

A wire level description of the Server-Sent Events specification would be extremely useful for developing a caching service like that. I can think of many more examples (monitoring service, etc), but the one I mentioned is a real life example that is currently being developed.

Please reconsider your resolution to this issue.
Comment 3 Ian 'Hixie' Hickson 2013-11-01 23:00:10 UTC
Why wouldn't you just change the Web service to expose the data in a more sane form, e.g. over a custom bidirectional TCP protocol that did away with the need for the proxy?
Comment 4 Chuck Wolber 2013-11-02 00:13:51 UTC
(In reply to Ian 'Hixie' Hickson from comment #3)
> Why wouldn't you just change the Web service to expose the data in a more
> sane form, e.g. over a custom bidirectional TCP protocol that did away with
> the need for the proxy?

There is little value in devolving this conversation down to how we should be engineering our product. Suffice to say given our unique constraints, it is easier for us to adapt to the existing protocol (Server-Sent Events), than it is to add another protocol handler to the existing service. We would love nothing more than to have a simplified protocol to interact with, but that option is not available to us at this time.

The larger issue remains that there are legitimate use cases for understanding the Server-Sent Event protocol at the wire level. A few that I can think of off the top of my head:

* Automated monitoring of customer web interface experience.
* Anyone crazy enough to develop a brand new web browser.
* Some people will simply understand this protocol better from this point of view.
Comment 5 Ian 'Hixie' Hickson 2013-11-04 22:03:23 UTC
> * Automated monitoring of customer web interface experience.

That's an interesting idea.


> * Anyone crazy enough to develop a brand new web browser.

They would presumably be developing a Web browser, so would need the spec as it is now, not one that doesn't do the API.


> * Some people will simply understand this protocol better from this point of
> view.

The introduction section explains the protocol, I don't think a normative description would help people understand it more than that.


But the idea of having a non-Web client as a way to test a Web service is interesting. However, what would it need to do beyond parsing it? (Parsing is already defined in a manner separate from browsers.) I mean, it's not really clear what it means for a testing framework to be conforming or not. Surely it can just do whatever it wants?
Comment 6 Ian 'Hixie' Hickson 2014-01-02 21:25:34 UTC
Basically it's just the "dispatch the event" algorithm that's browser-specific, right? Would it address your use case to have the spec instead invoke "the appropriate event-handling hook for the user agent" and have the appropriate one for browsers be the current "dispatch the event" algorithm?
Comment 7 Ian 'Hixie' Hickson 2014-02-07 23:35:39 UTC
My plan is to do what I describe in comment 6. If that isn't sufficient, please let me know.
Comment 8 contributor 2014-02-08 00:31:18 UTC
Checked in as WHATWG revision r8475.
Check-in comment: Make the EventSource processing model a mite more generic to allow other user agent types to implement this spec.
http://html5.org/tools/web-apps-tracker?from=8474&to=8475