O'Reilly logo

Node Cookbook Second Edition by David Mark Clements

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Cross-browser real-time logic with Socket.IO

Older browsers don't support WebSockets. In order to provide a similar experience in these browsers, we have to use techniques such as long polling, using the Flash plugin sockets, or proprietary browser-specific options such as ActiveX in Internet Explorer.

Naturally, this is a mine field, requiring hours of browser testing and in some cases highly specific knowledge of proprietary protocols (for example, IE's Active X htmlfile object).

Socket.IO (via the engine.io module) provides a WebSocket-like API to the server and client to create the best-case real-time experience across a wide variety of browsers, including old (IE 5.5+) and mobile (iOS Safari and Android) browsers.

Note

The engine.io module has ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required