This document summarizes a meetup about using Socket.IO for real-time applications. It discusses limitations of traditional HTTP requests/responses for real-time applications and solutions like long polling, streaming, and websockets. It notes that websockets are ideal but have limitations for older proxies and firewalls. Socket.IO provides an abstraction layer to use the best transport, including websockets, long polling, and streaming. The meetup will demonstrate Socket.IO through examples and code.
5. Real Time Web Applications
Pretty Moving Graphs
Feeds (Twitter, News, etc.)
Chatrooms
Html5 Multiplayer Games
6. Limitations of HTML
HTML Designed for Request/Response
1. Browser -> Server
2. Server -> Browser
3. Repeat
7. Solutions
HTML Protocol Hacks:
● Short Polling
● Long Polling
○ <script>
○ AJAX Long Polling
● Streaming
○ XMLHttpRequest Multipart Chunks
○ Forever Iframe
8. Problems with Hacks
● HTTP Overhead for many small updates
● Resource Waste in opening and closing
connections
● Latency Overhead
● Different Implementations for Each Browser
9. WebSockets To Rescue!
● Full Web Standard
designed for two way
communication
● Minimal Overhead for each
message
● Most Modern Browsers
Support it
10. WebSocket Limitations
● HTTP Upgrade
Handshake Breaks some
older Proxies
● Many Gateways, Load
Balancers, Reverse
Proxies Servers dont
support websocket
● Some Firewalls block
Websockets
11. Socket IO Got You Covered
Socket IO Real Time
Communication Library for both
server and client
● Abstract Layer over Multiple
Transports
○ Long Polling
○ Streaming
○ Websockets
○ Flashsockets (BLEH)
● Auto Reconnect, Heartbeats,
Auto Chooses Best Transport
13. How to Get Started
1. express example
2. enter example folder
3. npm install socket.io --save
Farsheedius Shall walk through the rest
For the impatient: echo example
https://github.com/eddify/socketio-starter