Home Page Icon
Home Page
Table of Contents for
Table of Contents
Close
Table of Contents
by Rohit Rai
Socket.IO Real-time Web Application Development
Socket.IO Real-time Web Application Development
Table of Contents
Socket.IO Real-time Web Application Development
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Going Real Time on the Web
What is real-time web?
A bit of history
Applications of real-time web
Gaming
Social stream updates
Business applications
Web-based monitors
Summary
2. Getting Started with Node.js
The origin of Node.js
Why Node.js
JavaScript everywhere
Event-driven design
Corporate backing
How to get Node.js
Node.js package manager (npm)
Hello World with Node.js
Hello Web
Routing the requests
HTTP Methods
Creating our own Modules
Serving files
Third party modules and Express JS
Summary
3. Let's Chat
Creating the application
Designing the chat room
Bringing in jQuery
Socket.IO
Handling events
The server
The client
Summary
4. Making It More Fun!
Giving names to users
More on events
Working with namespaces
Rooms
Listing the rooms
Sharing the session
Summary
5. The Socket.IO Protocol
Why do we need another protocol?
The WebSocket API
The Socket.IO API
The Socket.IO socket
The Socket.IO connection
Socket.IO messages
Disconnect (0)
Connect (1)
Heartbeat (2)
Message (3)
JSON message (4)
Event (5)
ACK (6)
Error (7)
NOOP (8)
Summary
6. Deploying and Scaling
The production environment
Running the application
Keeping it running
Scaling
The node cluster
Scaling up the application
Tips for node in production
Summary
A. Socket.IO Quick Reference
The server
Instantiating socket
Starting Socket.IO
Listening to events
Emitting an event
Sending a message
Sending a JSON message
Broadcasting a message/event
Sending a volatile message
Storing socket data
Getting the socket data
Restricting to a namespace
Joining a room
Broadcasting messages/events in a room
Leaving a room
Changing the configuration
Server events
connection
message
disconnect
The client
Connecting to a socket
Listening to events
Emitting an event
Sending a message
Client events
connect
connecting
disconnect
connect_failed
error
message
reconnect
reconnecting
reconnect_failed
B. Socket.IO Backends
Erlang
Google Go
Java
Perl
Python
Summary
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
Socket.IO Real-time Web Application Development
Table of Contents
Socket.IO Real-time Web Application Development
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Going Real Time on the Web
What is real-time web?
A bit of history
Applications of real-time web
Gaming
Social stream updates
Business applications
Web-based monitors
Summary
2. Getting Started with Node.js
The origin of Node.js
Why Node.js
JavaScript everywhere
Event-driven design
Corporate backing
How to get Node.js
Node.js package manager (npm)
Hello World with Node.js
Hello Web
Routing the requests
HTTP Methods
Creating our own Modules
Serving files
Third party modules and Express JS
Summary
3. Let's Chat
Creating the application
Designing the chat room
Bringing in jQuery
Socket.IO
Handling events
The server
The client
Summary
4. Making It More Fun!
Giving names to users
More on events
Working with namespaces
Rooms
Listing the rooms
Sharing the session
Summary
5. The Socket.IO Protocol
Why do we need another protocol?
The WebSocket API
The Socket.IO API
The Socket.IO socket
The Socket.IO connection
Socket.IO messages
Disconnect (0)
Connect (1)
Heartbeat (2)
Message (3)
JSON message (4)
Event (5)
ACK (6)
Error (7)
NOOP (8)
Summary
6. Deploying and Scaling
The production environment
Running the application
Keeping it running
Scaling
The node cluster
Scaling up the application
Tips for node in production
Summary
A. Socket.IO Quick Reference
The server
Instantiating socket
Starting Socket.IO
Listening to events
Emitting an event
Sending a message
Sending a JSON message
Broadcasting a message/event
Sending a volatile message
Storing socket data
Getting the socket data
Restricting to a namespace
Joining a room
Broadcasting messages/events in a room
Leaving a room
Changing the configuration
Server events
connection
message
disconnect
The client
Connecting to a socket
Listening to events
Emitting an event
Sending a message
Client events
connect
connecting
disconnect
connect_failed
error
message
reconnect
reconnecting
reconnect_failed
B. Socket.IO Backends
Erlang
Google Go
Java
Perl
Python
Summary
Index
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset