Paul Krill
Editor at Large

Socket.IO JavaScript framework ready for real-time apps

analysis
Jun 2, 20143 mins

Framework for mobile and Web apps has engine module and supports bidirectional, event-based communication

The Socket.IO real-time framework for mobile and Web applications is now available as a 1.0 release. The JavaScript framework, which leverages Node.js, features an engine module for reliability and supports bidirectional, event-based communication.

Socket.IO arose out of developer Guillermo Rauch’s quest to push data from the server to the client without the client requesting it. “It actually didn’t matter what kind of project it was, the need was always there. This came down to a bigger, fundamental need: speed,” Rauch said. Depending on the application, Socket.IO can save dramatic amounts of time in the communication path, he said.

The 1.0 release of Socket.IO bundlesis an engine module, Engine 1.0, which deals with transports and browser incompatibilities. Implementing a WebSocket-like API, Engine 1.0 allows for simplification of both the Socket.IO Server, which is only 1,234 lines of code, and Client, at 976 lines.

“This new engine we developed is a groundbreaking change in terms of reliability,” said Rauch, who works at blogging services provider Automattic. “Instead of attempting a connection with WebSocket, then falling back to something else — which can result in slow connection times — we try first what we know will always work, connect immediately, then try to upgrade to WebSocket [after] we test it and know it works.”

Socket.IO would have been difficult to envision without JavaScript on the server as well as the client, Rauch said. The message-encoding mechanism is based on JSON — which is natural to Node.js and browsers, he said. There is much code-sharing between the browser and server to minimize the need for code maintenance and reduce the room for human error and incompatibilities, he said.

Other capabilities featured in the 1.0 version come with automated testing, in which every commit to the Socket.IO codebase triggers a testing matrix of 25 browsers, including iOS and Android systems. Scalability and an integration capability, which turns existing applications into real-time applications, are highlighted as well. Also featured are streamlined APIs and better debugging. A planned Socket.IO 2.0 release is expected to abandon support for some older browsers and not bundle modules such as the JSON serializer.

Rauch said he started developing Socket.IO shortly after Node.js came out in 2009. The 1.0 release, which became available in late May, involved more than 30 contributors. Socket.IO users have included Microsoft Office, Yammer, and Zendesk, according to Socket.IO’s backers.

This story, “Socket.IO JavaScript framework ready for real-time apps,” was originally published at InfoWorld.com. Get the first word on what the important tech news really means with the InfoWorld Tech Watch blog. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author