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
WebSocketの圧縮機能とSocket.IO
Search
Naoyuki Kanezawa
February 10, 2015
Technology
9.4k
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.6k
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
Master Dataグループ紹介資料
sansan33
PRO
1
4.8k
Data Hubグループ 紹介資料
sansan33
PRO
0
3.2k
本番に近いテストをもっと手軽に - Postmanで広がるAPIテストの世界 / Expanding the World of API Testing with Postman
yokawasa
1
130
internal/testlog で遊ぼう
rokuosan
0
280
Introduction to Bill One Development Engineer
sansan33
PRO
0
480
AIレビュー時代に必要なのは、SLOで引く撤退ライン
nobuoooo
0
150
Digital Credentials API × OpenID4VP ブラウザ完結型本人確認の実装知見(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
330
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
460
会計事務所と顧問先の契約関係をOIDC・OAuthで表現する
terara
0
480
OpenID for Verifiable Credentials 実装から見えた相互運用性確保までの道のり(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
350
Distributed Transactions Under Fire: Building a Zero-Oversell Flash Sale Platform with Amazon Aurora DSQL
yama3133
0
100
顧客の要望は2次情報である 〜アンテナを張るFDEの構造論〜
noriakioji
5
1k
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
310
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
180
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
380
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Being A Developer After 40
akosma
91
590k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.1k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
290
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でも近いうちにサポート!