Socket.IO Cookbook

Over 40 recipes to help you create real-time JavaScript applications using the robust Socket.IO framework
Preview in Mapt

Socket.IO Cookbook

Tyson Cadenhead

1 customer reviews
Over 40 recipes to help you create real-time JavaScript applications using the robust Socket.IO framework
Mapt Subscription
FREE
$29.99/m after trial
eBook
$16.80
RRP $23.99
Save 29%
Print + eBook
$29.99
RRP $29.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$16.80
$29.99
$29.99p/m after trial
RRP $23.99
RRP $29.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Socket.IO Cookbook Book Cover
Socket.IO Cookbook
$ 23.99
$ 16.80
Build Complex Express Sites with Redis and Socket.io [Video] Book Cover
Build Complex Express Sites with Redis and Socket.io [Video]
$ 124.99
$ 106.25
Buy 2 for $34.30
Save $114.68
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781785880865
Paperback184 pages

Book Description

Socket.IO is a JavaScript library that provides you with the ability to implement real-time analytics, binary streaming, instant messaging, and document collaboration. It has two parts: a client-side library that runs in the browser, and a server-side library for node.js. Socket.IO is event-driven and primarily uses the WebSocket protocol that allows us to emit data bi-directionally from the server and the client. Socket.IO.

This book is a complete resource, covering topics from webSocket security to scaling the server-side of a Socket.IO application and everything in between.

This book will provide real-world examples of how secure bi-directional, full-duplex connections that can be created using Socket.IO for different environments. It will also explain how the connection vulnerabilities can be resolved for large numbers of users and huge amounts of data/messages.

By the end of the book, you will be a competent Socket.IO developer. With the help of the examples and real-world solutions,you will learn to create fast, scalable, and dynamic real-time apps by creating efficient messaging systems between the server side and the client side using Socket.IO.

Table of Contents

Chapter 1: Wiring It Up
Introduction
Creating a Node HTTP server with Socket.IO
Creating an Express server with Socket.IO
Using Socket.IO as a cross-browser WebSocket
Debugging on the client
Debugging on the server
Chapter 2: Creating Real-Time Dashboards
Introduction
Loading static data from the server
Creating a server-side clock
Loading data from MongoDB
Real-time analytics
Handling connection timeouts
Chapter 3: Having Two-Way Conversations
Introduction
Creating a simple chat room
Managing the socket life cycle
Emitting a private message to another socket
Sending messages to all the sockets, except for the sender
Building a multiplayer tic-tac-toe game
Chapter 4: Building a Room with a View
Introduction
Creating chat channels with namespaces
Joining rooms
Leaving rooms
Listing rooms the socket is in
Creating private rooms
Setting up a default room
Chapter 5: Securing Your Data
Introduction
Implementing basic authentication
Performing token-based authentication
Handling server-side validation
Locking down the HTTP referrer
Using secure WebSockets
Chapter 6: Performing a Load Balancing Act
Introduction
Performing load balancing with the Nginx server
Using the Node.js cluster
Using Redis to pass events between nodes
Using Memcached to manage multiple nodes
Using RabbitMQ to message events across nodes
Chapter 7: Streaming Binary Data
Introduction
Broadcasting an image to other sockets
Uploading an image to the filesystem
Uploading an image to Amazon S3
Streaming audio
Streaming live video
Chapter 8: Integrating with Mobile Applications
Introduction
Throwing an alert when the socket connects
Pushing up data from the server
Responding to tap events from the device
Doing server-side pagination
Triggering hot deploys

What You Will Learn

  • Build rich and interactive real-time dashboards using Socket.IO to pipe in data as it becomes available
  • Design chat and multiple-person interfaces that leverage Socket.IO for communication
  • Segment conversations to rooms and namespaces so that every socket doesn’t have to receive every message
  • Secure your data by implementing various authentication techniques, locking down the HTTP referrer and using secure WebSockets
  • Load balance across multiple server-side nodes and keep your WebSockets in sync using Redis, RabbitMQ or Memcached
  • Stream binary data such as audio and video in real-time over a Socket.IO connection
  • Create real-time experiences outside of the browser by integrating Socket.IO with hybrid mobile applications

Authors

Table of Contents

Chapter 1: Wiring It Up
Introduction
Creating a Node HTTP server with Socket.IO
Creating an Express server with Socket.IO
Using Socket.IO as a cross-browser WebSocket
Debugging on the client
Debugging on the server
Chapter 2: Creating Real-Time Dashboards
Introduction
Loading static data from the server
Creating a server-side clock
Loading data from MongoDB
Real-time analytics
Handling connection timeouts
Chapter 3: Having Two-Way Conversations
Introduction
Creating a simple chat room
Managing the socket life cycle
Emitting a private message to another socket
Sending messages to all the sockets, except for the sender
Building a multiplayer tic-tac-toe game
Chapter 4: Building a Room with a View
Introduction
Creating chat channels with namespaces
Joining rooms
Leaving rooms
Listing rooms the socket is in
Creating private rooms
Setting up a default room
Chapter 5: Securing Your Data
Introduction
Implementing basic authentication
Performing token-based authentication
Handling server-side validation
Locking down the HTTP referrer
Using secure WebSockets
Chapter 6: Performing a Load Balancing Act
Introduction
Performing load balancing with the Nginx server
Using the Node.js cluster
Using Redis to pass events between nodes
Using Memcached to manage multiple nodes
Using RabbitMQ to message events across nodes
Chapter 7: Streaming Binary Data
Introduction
Broadcasting an image to other sockets
Uploading an image to the filesystem
Uploading an image to Amazon S3
Streaming audio
Streaming live video
Chapter 8: Integrating with Mobile Applications
Introduction
Throwing an alert when the socket connects
Pushing up data from the server
Responding to tap events from the device
Doing server-side pagination
Triggering hot deploys

Book Details

ISBN 139781785880865
Paperback184 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Node.js Design Patterns Book Cover
Node.js Design Patterns
$ 29.99
$ 6.00
React.js Essentials Book Cover
React.js Essentials
$ 23.99
$ 16.80
Learning Docker Book Cover
Learning Docker
$ 39.99
$ 8.00
AngularJS Web Application Development Cookbook Book Cover
AngularJS Web Application Development Cookbook
$ 29.99
$ 6.00
Learning ECMAScript 6 Book Cover
Learning ECMAScript 6
$ 27.99
$ 19.60
Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40