Live data from Hacker News

A WebSocket Primer

caitiem.com

11–20 of 24 posts

Re: A WebSocket Primer

#11
post #5
post #4

It's funny that the article says "This enables server sent events" without actually referring to the HTML5 Server Sent Events API : http://www.html5rocks.com/en/tutorials/eventsource/basics/ SSE is realtime server->client protocol that's fully compatible with HTTP and has lower handshake overhead (no Upgrade roundtrip, doesn't require HTTPS to go through proxies).

Agreed. Both approaches have their place, but I see SSE getting overlooked too often.

I'm not 100% up to speed on SSE but since there is no way to "push" to a client isn't it just some form of polling at the end of the day?

It's also not supported by IE yet: http://caniuse.com/eventsource

Compare with http://caniuse.com/websockets

Re: A WebSocket Primer

#12
post #11
post #5

Earlier quoted context omitted.

Agreed. Both approaches have their place, but I see SSE getting overlooked too often.

I'm not 100% up to speed on SSE but since there is no way to "push" to a client isn't it just some form of polling at the end of the day? It's also not supported by IE yet: http://caniuse.com/eventsource Compare with http://caniuse.com/websockets

That's in keeping with how I think of it: open connection from the client with some reasonable expectations set around e.g. reconnection behavior.

Looks like Chrome and Firefox have had support for quite some time. I'm alright with that.

Re: A WebSocket Primer

#13
Would have rather seen sample code as Plain Old Javascript, or some other language that you can use without buying into the Microsoft ecosystem.

Suggest the title be changed to:

A WebSocket Primer for .Net 4.5

The rest of it is a cool read, though. Thanks for submitting.

Re: A WebSocket Primer

#16

Would have rather seen sample code as Plain Old Javascript, or some other language that you can use without buying into the Microsoft ecosystem. Suggest the title be changed to: A WebSocket Primer for .Net 4.5 The rest of it is a cool read, though. Thanks for submitting.

Maybe C# was just the language at hand when the research was done, perhaps as part of a day job. Why not blog something up about web sockets in JavaScript?

Re: A WebSocket Primer

#17
I've actually been writing a MUD in Node.js with WebSockets (well, Socket.IO, thus I get failover support). It's been a lot of fun, and has been really easy to use.

What is really interesting is just how easy it is to use WebSockets with the latest libraries. I've got a project in .NET that relies on a lot of Microsoft-specific libraries right now. But with the ease of WebSockets, I can rewrite the UI in HTML5 like we always wanted and get around to rewriting the MS-specific stuff in Java or Python more likely whenever I feel like it.

It's like completely platform agnostic pipes, in a way that TCP/IP sockets never seemed to quite do.

EDIT: I think it's just that I don't have to listen for new connections and figure out how to bind them in a loop that I keep alive myself. I get an event when users connect.

Re: A WebSocket Primer

#18
post #4

It's funny that the article says "This enables server sent events" without actually referring to the HTML5 Server Sent Events API : http://www.html5rocks.com/en/tutorials/eventsource/basics/ SSE is realtime server->client protocol that's fully compatible with HTTP and has lower handshake overhead (no Upgrade roundtrip, doesn't require HTTPS to go through proxies).

Do SSEs now support CORS? I know when writing a webapp at the start of this year we went with Websockets because we needed to work in a cross domain environment and SSEs didn't support it; I know it was to be added to the standard, and Firefox had unofficial support of it, but I can't find anything anywhere indicating if Chrome and Safari are supporting it (and IE will probably get it in 12 eyeroll).

Re: A WebSocket Primer

#20
post #11
post #5

Earlier quoted context omitted.

Agreed. Both approaches have their place, but I see SSE getting overlooked too often.

I'm not 100% up to speed on SSE but since there is no way to "push" to a client isn't it just some form of polling at the end of the day? It's also not supported by IE yet: http://caniuse.com/eventsource Compare with http://caniuse.com/websockets

IE is just trying to look all hip and cool and EventSource hasn't generated much hype so it doesn't get implemented.. shame.
Post reply on HN