Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
WebSockets (sflive2012)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Igor Wiedler
June 08, 2012
Programming
6
2.7k
WebSockets (sflive2012)
Igor Wiedler
June 08, 2012
Tweet
Share
More Decks by Igor Wiedler
See All by Igor Wiedler
Redis Bedtime Stories
igorw
1
330
Wide Event Analytics (LISA19)
igorw
4
930
a day in the life of a request
igorw
0
160
production: an owner's manual
igorw
0
180
The Power of 2
igorw
0
320
LISP 1.5 Programmer's Manual: A Dramatic Reading
igorw
0
460
The Moral Character of Software
igorw
1
290
interdisciplinary computing (domcode)
igorw
0
310
miniKanren (clojure berlin)
igorw
1
310
Other Decks in Programming
See All in Programming
JPUG勉強会 OSSデータベースの内部構造を理解しよう
oga5
2
230
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
570
朝日新聞のデジタル版を支えるGoバックエンド ー価値ある情報をいち早く確実にお届けするために
junkiishida
1
370
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
280
2026/02/04 AIキャラクター人格の実装論 口 調の模倣から、コンテキスト制御による 『思想』と『行動』の創発へ
sr2mg4
0
680
Fundamentals of Software Engineering In the Age of AI
therealdanvega
0
160
CSC307 Lecture 13
javiergs
PRO
0
310
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.5k
Claude Code、ちょっとした工夫で開発体験が変わる
tigertora7571
0
200
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
390
Unity6.3 AudioUpdate
cova8bitdots
0
110
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
7.6k
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.3k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
230
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
140
Navigating Weather and Climate Data
rabernat
0
130
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
850
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.1k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
93
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
For a Future-Friendly Web
brad_frost
183
10k
From π to Pie charts
rasagy
0
140
Transcript
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