Introduction

As shown in the preceding chapter, you can use a standard HTTP architecture to build multiplayer social games. There are some limits, however, to what type of game you can build without resorting to various hacks if you want the server to push data to the client. WebSockets provides a solution to this problem by bringing a socket-based, real-time, two-way conversation mechanism natively to the browser. This chapter examines building real-time games using a Node.js library named Socket.io, which supports WebSockets and a number of fallback mechanisms.

Get Professional HTML5 Mobile Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.