HNHacker News
TopNewBestAskShowJobs

leggetter

136 karma · joined August 31, 2010

DX/DevRel/PLG

[ my public key: https://keybase.io/leggetter; my proof: https://keybase.io/leggetter/sigs/hlhxnvujaOEI6-gPUGXCDsplKgltdzl7DM8r3F-JuAE ]

submissionscomments
leggetter··on How we built Pusher-JS 2.0 – part 2 – implementation
We've kept the FlashSocket option in there, as it ultimately means the user gets the benefit of a WebSocket connection without native WebSocket support; a single bidirectional connection resulting in the lowest latency possible.

Our HTTP fallback offers XHR Streaming, XHR Long-polling, IFRAME options (streaming, polling htmlfile etc.) and JSONP-polling for older browsers.

The preference is of course a WebSocket connection, then streaming (as it means a persistent connection is created), then long-polling, then standard polling. The problem with any sort of polling is that it's generally inefficient and there are periods of time where a connection isn't established - this means data on the client may not be the most up to date (stale).

We all know: WebSocket FTW! :)

leggetter··on Cisimple releases RESTful/real-time API w/ Pusher channels
Blog post providing some details about the way Pusher was integrated http://blog.pusher.com/using-pusher-to-power-cisimples-real-...
leggetter··on MMO xkcd WebSockets fixed by PubNub
It definitely makes sense to split the world up into multiple channels. That's what the guys who built http://wordsquared.com/ did. As you scroll you unsubscribe from channels that are out of view and subscribe to channels that are moving into view. You could think of it in a similar way to how Google Maps tiling works.
leggetter··on Build Your Own Home Automation w/ Pusher, Twilio, and Arduino
http://reaDIYmate.com are pretty cool too.
leggetter··on Real-time Control of a Hexbug using Arduino, Pusher.com, and Websockets
Nice little example of the Internet of Things
leggetter··on WebSockets: Stable and Ready for Developers
When it comes to nginx and apache you can always go down the hosted realtime infrastructure route. That way you can use WebSockets in your client (app) but you don't need to worry about installing mods or handling the persistent connections on your server.

See: http://www.leggetter.co.uk/real-time-web-technologies-guide#...

leggetter··on WebSockets: Stable and Ready for Developers
Some expect Chrome for Android to become the default browser (http://www.wired.com/gadgetlab/2012/02/chrome-android/) and if that happens the WebSockets will be supported. Firefox for Android also supports WebSockets.

I can't 100% confirm Chrome will become the default but Google are very pro WebSockets so it would be very strange for them not to support and encourage their use.

There are fallback options in place that mean WebSockets can be used on Android but that tends to mean Flash lite also has to be installed.

leggetter··on WebSockets: Stable and Ready for Developers
From my experience, working at Pusher and dealing with support for the past year, WebSockets do work over a mobile 3G connection when you use an SSL (wss://) connection. I tether (laptop -> mobile -> mobile data) quite a bit whilst travelling and my mobile data provider, O2, do all sorts of annoying things with dat (stop whitespace, inject JavaScript), but my WebSocket connections work flawlessly.

In the same way that a WebSocket library can fallback from a WebSocket connection to a HTTP-based connection it can also first try ws:// and then fallback to wss:// - it's what our library does. The potential problem here of course is that you need an SSL certificate. When using Pusher that's not a problem, because we've bought one, but when using your own hosted solution that might mean dishing out money that you'd rather not.

leggetter··on WebSockets: Stable and Ready for Developers
> try websockets, if fails, use comet

I've seen this statement, or similar, a few times. But, Comet servers use WebSockets. So, WebSockets are not an alternative to Comet. They are a transport technology that is better suited to the Comet paradigm, and building interactive web apps, than HTTP (Long-Polling, Streaming). Here's a diagram I create a while back which hopefully explains my point of view: http://i.stack.imgur.com/BOFC2.png

Spot-on about the benefits of WebSockets over HTTP-based solutions when it comes to efficiency. The HTTP connection limit was a problem a while back but I don't believe it is any more.

leggetter··on Firebase (YC S11) aims to reinvent real-time apps and already has 4,000 sign-ups
I love the technology, I've had a play with building a mini-app in their interactive tutorial, but I really want to see their security model. How is it possible to stop a user opening up the JavaScript console of the web browser and writing code? There are authentication mechanisms you can use, tokens etc. but that just authenticates that user. They can still start hacking.

Maybe the thought is to let a user hack with their own data?

What's the solution when it comes to shared application data?

Will they ultimately need to let app developers deploy server logic on their infrastructure for the security solution?

Also, amazing job by their PR contacts for getting so much coverage and creating such an amazing buzz.

leggetter··on WebSockets: Stable and Ready for Developers
Great idea. Exactly what somebody should have done with HTTP Long-Polling and Streaming (XHR, IFRAME, ActiveX etc.) but without a standardised API it was difficult. The WebSockets API let's us do this.
leggetter··on WebSockets: Stable and Ready for Developers
Are their commercial versions of socket.io for C# available? When it comes to .NET people tend to go with signalR (which I think has WebSocket support but not within ISS - until Windows 8 server), SuperWebsocket or XSockets.
leggetter··on WebSockets: Stable and Ready for Developers
The point in abstraction in this case is to add additional functionality.

The most obvious option, and something I thought might have become part of the WebSocket API, is auto-reconnection. To reconnect you need to create another WebSocket object and reattach all your event listeners. So, I'm convinced that the majority of people who use WebSockets will have to write their own custom code for this and will probably put it in their own little library which wraps around using WebSocket objects.

More info in the comment here: http://www.sitepoint.com/websockets-stable-and-ready-for-dev...

leggetter··on WebSockets: Stable and Ready for Developers
https://github.com/gimite/web-socket-js is a good fallback which uses Flash Sockets. Whether you can use them or not really depends on your target user. I'd argue that for the general public you can use them; they'll be using IE with Flash, Firefox or Chrome. With the latter two you'll have native WebSocket support and with all three it's highly likely that all with have Flash installed. Things are trickier for corporate users where it depends on the corporate IT policy. As ever, there are edge cases.
leggetter··on WebSockets: Stable and Ready for Developers
By a guy from Microsoft so plenty of MS examples/links, but a good overview of WebSockets never the less. I'm interested to hear how many of use will ever actually use the `WebSocket` object? Will we (developers) always use a library offering a layer of abstraction and the real core functionality that we need.
leggetter··on Real-Time Web Technologies Guide
Will do my best to update ASAP.
leggetter··on Real-Time Web Technologies Guide
Realtime web browser technology has been around for over 10 years; HTTP Polling, HTTP Long-Polling, HTTP Streaming and now WebSockets. Connections can only be established between the client and server if various security restrictions and policies are met (See CORS and the WebSocket protocol).
leggetter··on Real-Time Web Technologies Guide
The list is on my site (just found the HN thread). How would you like to see the list improved? My plan is better categorisation and improved (or actually add) descriptions.
leggetter··on Real-Time Web Technologies Guide
Yep, SignalR is a self hosted solution and I've added it into that category. Microsoft backed so it'll probably become the core offering for self hosted IIS solutions. I'm interested to see some benchmarking done with it to see how it, and more importantly IIS, deals with concurrent connections.
leggetter··on Real-Time Web Technologies Guide
Most of the sections are brief and the core focus is keywords, although I understand some more information would be beneficial. Since the guide is getting a bit of traffic at the moment I'll try to find some time to update it, add more technologies and provider better overviews.
leggetter··on Introducing Pusher WebHooks
There's also a demo + code of the WebHooks in action here: http://blog.pusher.com/2011/12/7/filtrand-a-demo-webhooks
leggetter··on Ask HN: Review our product Beacon - a hosted Comet push service with WebSockets
There are a number of similar services available and this is certainly something that should become commonly used over the next few months and years.

Other services are PusherApp, PubNub, Kwwika, Hookbox and WebSync on demand. I'm sure that more services will also pop-up over the next few years.

If you don't want to use a service you can always download, install and maintain your own comet server - but the whole point in a service such as this is that it removes the pain of doing it.

I've also heard rumours that Google App Engine will be adding native support for this. I believe Google already use the technology for things like the real-time news JavaScript API.

← PreviousPage 2 of 2