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
WebSocketの圧縮機能とSocket.IO
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Naoyuki Kanezawa
February 10, 2015
Technology
9.5k
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WebSocketの圧縮機能とSocket.IO
websocketのpermessage-deflate extensionについて
Naoyuki Kanezawa
February 10, 2015
More Decks by Naoyuki Kanezawa
See All by Naoyuki Kanezawa
Introducing Now and Next.js
nkzawa
12
5.7k
Socket.IO 1.0 Client for Javaの紹介
nkzawa
5
1.9k
Socket.IO 1.0の変更点・内部的な話
nkzawa
20
9.4k
Other Decks in Technology
See All in Technology
演劇と私とスクラム
chinmo
0
140
書き手が人でもAIでも正しくなる道、SREを埋め込んだDeveloper Platform / tech drivers day8
chmikata
4
690
ストレスなくAIと付き合いたい!こんなときどうしてる?
namiki64
4
690
FinOps Agentが生んだ技術負債:コスト自動調査の落とし穴と解消までの道のり
oasis1994liveforever
3
290
正解のない研修に放り出されて / Being thrown into a training program with no right answers
ohnoeight
1
140
AWSDirectConnectの構築の進め方を整理してみた
masa_my
1
180
AI時代、つくる力を自分たちの手に。 ──電通×KAG、アジャイルとAI駆動開発で挑む開発の変革
yuukiyo
3
360
React改造してみた
tsukina_7mochi
0
160
How we choose session proposals
kawaguti
PRO
0
150
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
370
sue445's proposals 2026
sue445
0
140
What Is JetBrains Air
x5gtrn
PRO
0
170
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
450
A better future with KSS
kneath
240
18k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
540
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
540
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
Transcript
WebSocketの圧縮機能と Socket.IO 2/10 Node学園#15
ID: nkzawa socket.io コミッター
最近 ws モジュールに permessage-deflate extension を実装しました
wsモジュール nodeのデファクトwebsocket server/client socket.ioでも使用している
古くからあるissueを解決 ws#34 3年前 socket.io#1148 2年前
None
None
permessage-deflate とは
メッセージデータを deflate 圧縮する WebSocketの拡張
HTTPでいうところのgzip圧縮
None
None
permessage-deflate vs http compression
最も重要な違い http: レスポンスにのみ適用 websocket: 双方向
圧縮パラメータ http: 圧縮データのheaderに含める websocket: ハンドシェイク時に交換
windowBits: ウィンドウ・サイズ noContextTakeOver: コンテキストを引き継ぐかどうか
Context Takeover 各メッセージを同一コンテキストで圧縮すること で圧縮率を改善
None
残念なお知らせ
現状Chromeのみサポート ( FireFoxはv37から )
ブラウザでは設定変更ができない JSのWebSocket APIにインターフェースがないため、 常に有効かつデフォルト値で動作する。
謝辞
この機能に関連するNodeの脆弱性を、 @jovi0608 (Shigeki Ohtsu) さん に直していただいたおかげで、 無事リリースできました!m(__)m
socket.io では
次バージョン (v1.4) でサポートされます。 (そもそもsocket.ioのために実装した)
• 圧縮がデフォルトで有効 • polling時はhttp圧縮 • メッセージ毎にon/offを切り替え可能
var socket = io({ perMessageDeflate: true, httpCompression: true }); socket.compress(false).emit(‘woot’);
まとめ
• 地味な機能だけど、パフォーマンス改善にイ ンパクトは大きいはず! • Socket.IOでも近いうちにサポート!