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
320
Wide Event Analytics (LISA19)
igorw
4
930
a day in the life of a request
igorw
0
150
production: an owner's manual
igorw
0
170
The Power of 2
igorw
0
310
LISP 1.5 Programmer's Manual: A Dramatic Reading
igorw
0
450
The Moral Character of Software
igorw
1
290
interdisciplinary computing (domcode)
igorw
0
300
miniKanren (clojure berlin)
igorw
1
310
Other Decks in Programming
See All in Programming
ゆくKotlin くるRust
exoego
1
220
2026年 エンジニアリング自己学習法
yumechi
0
120
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1k
Implementation Patterns
denyspoltorak
0
270
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
620
gunshi
kazupon
1
140
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
530
Package Management Learnings from Homebrew
mikemcquaid
0
120
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
180
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
360
CSC307 Lecture 02
javiergs
PRO
1
770
Featured
See All Featured
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
KATA
mclloyd
PRO
34
15k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
Design in an AI World
tapps
0
140
Embracing the Ebb and Flow
colly
88
5k
It's Worth the Effort
3n
188
29k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
ラッコキーワード サービス紹介資料
rakko
1
2.1M
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1.1k
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