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
Socket.IO in Chess Realtime Multiplayer Web App...
Search
Conferences Box
November 30, 2012
Technology
340
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Socket.IO in Chess Realtime Multiplayer Web Application
Conferences Box
November 30, 2012
More Decks by Conferences Box
See All by Conferences Box
Multiple dispatch
conferencesbox
1
62
JQuery UI Keynote
conferencesbox
1
93
Sensible Testing
conferencesbox
2
100
Redis Application Patterns in Rails
conferencesbox
1
130
Making the Web Faster
conferencesbox
2
80
Using Rails without Rails
conferencesbox
1
110
Stranger in These Parts
conferencesbox
1
71
One day of life in V8
conferencesbox
3
260
Continuous Deployment
conferencesbox
1
100
Other Decks in Technology
See All in Technology
IHV like なユースケースへのOpenID Connect 関連仕様の適用事例
optim
0
290
Windows の互換機能 - 古いプログラムはなぜ動作できるのか
murachiakira
PRO
0
110
型落ちシンクライアント端末のPoEモジュールを自作したかった話
logica0419
0
450
AI開発に用いられるHPC技術について
gpuunite_official
0
290
1000⼈規模のClaude Enterprise運⽤を「Oktaのグループ」と「Slack」に集約する
sansantech
PRO
0
400
Master Dataグループ紹介資料
sansan33
PRO
1
4.8k
Introduction to Bill One Development Engineer
sansan33
PRO
0
470
Eight Engineering Unit 紹介資料
sansan33
PRO
3
8.3k
わたしが知り合いゼロの勉強会に 行けるようになるまで
r5ni4
2
800
internal/testlog で遊ぼう
rokuosan
0
230
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
20k
あなたの知らないバージョン命名規則
sat
PRO
2
780
Featured
See All Featured
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
The Curse of the Amulet
leimatthew05
2
14k
Design in an AI World
tapps
1
290
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.9k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
500
Paper Plane (Part 1)
katiecoart
PRO
1
10k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Darren the Foodie - Storyboard
khoart
PRO
3
3.7k
Transcript
Socket.IO in Chess Realtime Multiplayer Web Application @OmarQunsul
None
None
None
None
None
Websockets
None
Mozilla Firefox 4 in 2010 dropped the support for Websockets,
due to security issues.
What ?
None
http://www.socket.io
WebSocket Adobe® Flash® Socket AJAX long polling AJAX multipart streaming
Forever Iframe JSONP Polling
Server ( node.js ) Socket.IO Client Browser JS
NODE.JS ( Server ) var io = require('socket.io').listen(80); io.sockets.on('connection', function
(socket) { socket.emit('news', { hello: 'world' }); socket.on('my other event', function (data) { console.log(data); }); });
NODE.JS ( Server ) var io = require('socket.io').listen(80); io.sockets.on('connection', function
(socket) { socket.emit('news', { hello: 'world' }); socket.on('my other event', function (data) { console.log(data); }); });
NODE.JS ( Server ) var io = require('socket.io').listen(80); io.sockets.on('connection', function
(socket) { socket.emit('news', { hello: 'world' }); socket.on('my other event', function (data) { console.log(data); }); });
Browser ( Javascript ) <script src="/socket.io/socket.io.js"></script> <script> var socket =
io.connect('http://localhost'); socket.on('news', function (data) { console.log(data); socket.emit('my other event', { my: 'data' }); }); </script>
Browser ( Javascript ) <script src="/socket.io/socket.io.js"></script> <script> var socket =
io.connect('http://localhost'); socket.on('news', function (data) { console.log(data); socket.emit('my other event', { my: 'data' }); }); </script>
Browser ( Javascript ) <script src="/socket.io/socket.io.js"></script> <script> var socket =
io.connect('http://localhost'); socket.on('news', function (data) { console.log(data); socket.emit('my other event', { my: 'data' }); }); </script>
Socket.IO + Express var app = require('express')() , server =
require('http').createServer(app) , io = require('socket.io').listen(server); server.listen(80); app.get('/', function (req, res) { res.sendfile(__dirname + '/index.html'); }); io.sockets.on('connection', function (socket) { socket.emit('news', { hello: 'world' }); socket.on('my other event', function (data) { console.log(data); }); });
C++, Objective C, Ruby, Python, Erlang, Lua, Perl, Go, PHP
... and many more. Unofficial server side implementations
Desktop Internet Explorer 5.5+ ! Safari 3+ Google Chrome 4+
Firefox 3+ Opera 10.61+ Mobile iPhone Safari iPad Safari Android WebKit WebOs WebKit Browser Support
For more information, demos http://socket.io
chessduo.com and oh, my chess website is
Thanks !