Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
WebSockets (sflive2012)
Search
Igor Wiedler
June 08, 2012
Programming
2.8k
6
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WebSockets (sflive2012)
Igor Wiedler
June 08, 2012
Transcript
58 slides
WEBSOCKETS
• Symfony2 • Silex • Composer igorw @igorwesome
WEBSOCKETS
WEB
Application HTTP Presentation TCP Session TCP Transport TCP Network IP
Data Link Physical
Application HTTP Presentation TCP Session TCP Transport TCP Network IP
Data Link Physical
client
request client
reponse client request
THIS IS A GOOD THING
BUT
NOT FOR EVERYTHING
UNIDIRECTIONAL
None
LATENCY
LATENCY KEEP-ALIVE PIPELINING SPDY
STATELESS
Application HTTP Presentation TCP Session TCP Transport TCP Network IP
Data Link Physical
Application HTTP Presentation TCP Session TCP Transport TCP Network IP
Data Link Physical
WEBSOCKETS
SOCKETS
WEBSOCKETS
PROTOCOL API
THE WEBSOCKET PROTOCOL
browser
None
• Handshake / Upgrade • TCP + framing • Proxies
• Supports TLS (SSL)
RFC 6455
THE WEBSOCKET API
browser
var ws = new WebSocket('ws://example.org:8080/updates'); ws.onopen = function () {
ws.send('hello'); }; ws.onmessage = function (event) { console.log(event.data); };
USE CASES •Games •Notifications •Collaboration •Statistics •Chat
4.0+ (2009) 6.0+ (2011) 10.70+ (2012) 5.0+ (2010) 10+ (2012)
• transport abstraction (fallbacks) • broadcasting, reconnection, serialization, other stuff
• monolithic! (and almost trying to fix it)
SOCKJS
var ws = new WebSocket(url);
var ws = new SockJS(url);
ASYNC STACK Connect Express SockJS
ASYNC STACK ? ? SockJS
ASYNC STACK EventMachine ? ? SockJS
ASYNC STACK ? ? SockJS
Y U NO PHP?
SYNC STACK Application
ASYNC Connect Express SockJS SYNC Application
None
None
*MQ
*MQ Sync Async
DEMO
DEBUGGING •printf •chrome inspector •wssh •ngrep •zmqc
RECAP • Use SockJS • Polyglot is the future •
Learn from the MQs
LINKS • tools.ietf.org/html/rfc6455 • dev.w3.org/html5/websockets • sockjs.org
github.com/igorw/websockets-talk
CREDITS • thenounproject.com • stopwatch
None
None
nodephp.org github.com/cboden/Ratchet
Questions? @igorwesome speakerdeck.com /u/igorw joind.in/6586
More Decks by Igor Wiedler
See All by Igor Wiedler
Redis Bedtime Stories
igorw
1
400
Wide Event Analytics (LISA19)
igorw
4
970
a day in the life of a request
igorw
0
190
production: an owner's manual
igorw
0
210
The Power of 2
igorw
0
370
LISP 1.5 Programmer's Manual: A Dramatic Reading
igorw
0
520
The Moral Character of Software
igorw
1
340
interdisciplinary computing (domcode)
igorw
0
340
miniKanren (clojure berlin)
igorw
1
360
Other Decks in Programming
See All in Programming
SONY CISC-NEWS NWS-1750 + NWB-225 ハードウェアメンテとフレームバッファカラー対応 / KOF2026
tsutsui
0
120
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
6
1.6k
Distance field of Julia set
kinakomoti321
0
330
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
15
12k
Secure Your Coding Agent Like It’s Malware (v1.5) 🇬🇧 @Code.talks 2026
richargh
0
190
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
3
210
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
960
はじめてのPLATEAU
nokonoko1203
1
660
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
260
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
320
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
700
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
400
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
530
エンジニアに許された特別な時間の終わり
watany
109
250k
Code Review Best Practice
trishagee
74
20k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
570
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
HDC tutorial
michielstock
2
1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Documentation Writing (for coders)
carmenintech
77
5.6k
The Curse of the Amulet
leimatthew05
4
17k
Marketing to machines
jonoalderson
1
6k