News for hackers. Stuff that matters.
Re:DIY Meteor-like Realtime Functionality Using Socket.io an... by phaedryx on Sunday March 13, 2016 @11:17PM (#11280845)
One thing that I've never understood is why websockets instead of server sent events?
Re:DIY Meteor-like Realtime Functionality Using Socket.io an... by jamescun on Monday March 14, 2016 @06:59AM (#11282101)
Possibly Internet Explorer support. Even Edge doesn't support them yet[1].

With deployments of HTTP/2 increasing, I think we'll see greater adoption of server sent events. At the time of writing, HTTP/2 and WebSockets are two incompatible standards. For non-latency sensitive applications (i.e. not games) it is very easy to implement a WebSocket like interface over HTTP/2 using SSE (server -> client) and POST requests (client -> server) with very little overhead (thanks to HTTP/2's multiplexing).

[1] http://caniuse.com/eventsource

Re:DIY Meteor-like Realtime Functionality Using Socket.io an... by jkarneges on Sunday March 13, 2016 @11:52PM (#11280953)
WebSocket is more well known than SSE, and it's also what Socket.io uses, so I think this isn't always a conscious choice. Developers are still discovering that SSE is a thing.

Another factor is that most apps using a socket-ish connection tend to run almost all traffic over the socket as opposed to just "push" traffic. This can make sense if the exchanges aren't very resource-oriented compared to a REST API.

Re:DIY Meteor-like Realtime Functionality Using Socket.io an... by djKianoosh on Monday March 14, 2016 @08:33AM (#11282440)
I'd love to use a sane, simple SSE server impl in Java. Does one exist? I see there's very little about plain java event source servlet implementations. Looks like there's some promising things in Jersey and Atmosphere at least, but things tend to get complicated quick in the java world...