SlideShare a Scribd company logo
1 of 34
Yet another html5j meetup on July 5th, 2012




WEBSOCKET PROTOCOL


                          http://goo.gl/0kJGW
2012/7/5(THU)
KENSAKU KOMATSU
SELF-INTRODUCTION
• Researching cutting-edge web technology
   • Especially APIs related to NW, in preference 



• Google API Expert (HTML5)
• Microsoft Most Valuable Professional(IE)


• Twitter: @komasshu
• Blog: http://blog.livedoor.jp/kotesaki
ACTIVITIES                   http://www.html5rocks.com/en/tutorials/speed/quick/


(I LOVE SPEED!!)




                                      Referred!!, But… orz
                                      (I know I should do feedback)




          http://wakachi.komasshu.info/
TODAY’S MAIN IDEA

Two topics


1. Introduction to WebSocket and
   SPDY


2. Dive into WebSocket Protocol.
http://www.flickr.com/photos/cubedude27/4892016155/




TOPIC1:




Introduction to WebSocket and
SPDY
EVOLVINGOF
    WEB SERVICES
1991                                                                                             2012
http://www.ibarakiken.gr.jp/www/index.html   http://www.ocn.ne.jp/   https://www.facebook.com/
COMMUNICATION MODEL
    HAS BEEN CHANGED
1991                                                                                               2012
http://www.ibarakiken.gr.jp/www/index.html     http://www.ocn.ne.jp/   https://www.facebook.com/




                                                                         Multiple resources
        Single resource                                                           +
                                             Multiple resources            Bi-directional
TRANSPORT
PROTOCOLHAS NOT
CHANGED


REQUEST   GET index.html

                           RESPONSE

REQUEST   GET style.css

                           RESPONSE
ISSUESINHTTP
Slowinmultiple resources   Periodically polling




                                                   hello!




                                         “hello”
CURRENT PRACTICE
FOR SOLVING ISSUES
Concurrent tcp connections   Long Polling




                                                      hello!



                                            “hello”
BUT STILL…
• Concurrent tcp request
  • Increase server load
  • Heavy loadto intermediary
      • e.g. NAT, proxy, FireWall…
• Long polling
  • Complicated coding
  • Increase traffics
      • Header: k – 10k order
      • Payload : 10 bytes order …
CUTTING EDGE
PROTOCOLS
SPDY, WEBSOCKET
SPDY                    WebSocket




                           ・Enable bidirectional
                            communication wo/
                                restrictions.
                           (request not needed)
                           ・Header overhead is     hello!
                              extremely small.
   ・Multiplex request
   Under single https                 “hello”
     connection.
PROTOCOL STACKS


                     SPDY              WebSocket
                 SPDY (HTTP layer)      Any protocols

                SPDY (framing layer)     WebSocket
                              TLS                  TLS

                        TCP                 TCP


SSBP will be applied here?
A COMPARATIVE
TABLE
               SPDY                         WebSocket
Goal           reduce the latency of web    provide two-way
               pages                        communication to browser-
                                            based application
How to setup   1. apply patch/module to     1. setup middleware
                  your middleware           2. write server side
                                               programming
                                            3. write client side javascript
Migration      very easy                    expensive
Coding skill   not required                mandatory
What we can    Fast while downloading web   Anything (especially bi-
serve?         resources.                   directional webapps (e.g.
                                            chat, push services, online
                                            game ))
TOPIC2:



 Dive into WebSocket Protocol




            http://www.flickr.com/photos/nektar/6085553520/sizes/z/in/photostream/
DEMO:MULTI DEVICE
                         WebIntents
                               +

INTERACTION
                       ServiceDiscovery
                            (uPnP)




                    WebSocket
DEMO: COMPARATIVE
TEST (WS VS HTTP)




    http://refws.komasshu.info/echocompare.html
REF: CASE HTTP
// send request
$.get(“http://example.com”, function(data, e) {
// when data is received
console.log(data);
});




                              To receive data, sending request must be
                                              required.
HOW TO USE WEBSOCKET?
(BROWSER SIDE API)
// initiate connection
varws = new WebSocket(“ws://example.com/”);
// right after connection established
ws.onconnect = function(e) { ... };
// when data arrival from server
ws.onmessage = function(e) { console.log(e.data); }
// send data to server
ws.send(“hello”);
// close connection
ws.close();
                                sending and receiving data works
                                         independently.
PROTOCOL OVERVIEW
The WebSocketProtocol (RFC6455)


•Has two parts
  • handshake
       • in context of HTTP/1.1
  • data transfer
       • frame format
•protocol schema
  • ws (80), wss(443)
•browsers
  • chrome, firefox, safari, opera(need configuration), IE10
  • iOS safari, Android browser (Chrome)
SEQUENCE OVERVIEW


          handshake



         data transfer




            closing
HANDSHAKE
 client to server




                    server to client
DATA FRAMING
                     indicates text, binary, ping, pong, close ...




      Payload data is masked with Masking-key (XOR base)
      (preventing Firewall Circumvention & Cache Poisoning)
WHAT FOR
PING/PONG?
                Under no-traffic, intermediaries
                    release session table




                                              Load
                               Fire
                NAT                           Balan
                               Wall
                                               cer
 websocket
 connection

              Known as “silent close”.
WHAT FOR
  PING/PONG? [CONT]



                                      Load       ping
                             Fire
                   NAT                Balan
   pong                      Wall
                                       cer
     websocket
     connection



ping & pong is used to prevent silent close (Keep-alive)
ADDITIONAL INFO
 CGN IN MOBILE NW
CGN is already installed into almost all mobile career NW.
So using ping/pong is necessary (also thinking about battery issues).




                                 G

                        Career Grade NAT
                    P        P        P      P
                     IPv4 Private address NW
GETTING REACH
ABILITY
                Treat WS traffic as HTTP/1.1
               ⇨ Data framing will blocked ;-(




                                           Load
                              Fire
               proxy                       Balan
                              Wall
                                            cer
 websocket
 connection



         Use WSS (prevent interruption)
SUBPROTOCOL
•WebSocket can handle any data schema.
  • example: transfer mouse coordinates
        • option1 : {x: 1, y:240}
        • option2 : [1, 240]
        • option3 : {x: “1px”, y: “240px”}
  • ...... lack of interoperability


•subprotocol addresses the interoperability problem
  • define schema, sequence, ...
  • should register IANA
        • identifier, common name, definition
SUBPROTOCOL[CONT]




      http://www.iana.org/assignments/websocket/websocket.xml
EXTENSION
Two proposal are now discussed.


•Multiplexing Extension
  • http://tools.ietf.org/html/draft-ietf-hybi-websocket-multiplexing-
    03

•Per-frame Compression
  • http://tools.ietf.org/html/draft-ietf-hybi-websocket-perframe-
    compression-04
SOCKET.IO
Automatically fallback from WebSocket to Comet.
Automatic keep-alive, name space, ... very convenient!!




                                           http://socket.io/
FOR SCALABLE
   SERVICES

                           redis, mongoDB, ...             sync status /
                                                          message sharing



             WS            WS           WS        WS
            server        server       server    server




node-proxy
                              Load balancer                some persistency
nginx(work in progress)
                                                              will required
                                                            (source IP hash,
                     user access                               cookie ...)
CONCLUSION
•WebSocket
 •   provide two-way communication to browser-based application
 •   NO request & response restrictions
 •   default port is 80 (ws), 443(wss)
 •   consists of two parts
         • handshake : upgrade mechanism
         • data transfer : text (utf-8) and binary
 • ping/pong
         • prevent silent close
 • wss
         • get reach ability
 • subprotocol
         • interoperability
 • extensions
         • multiplexing, per-frame compression
http://www.flickr.com/photos/23086934@N02/2250806050/

More Related Content

What's hot

Websocket protocol overview
Websocket protocol overviewWebsocket protocol overview
Websocket protocol overviewallenmeng
 
HTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the WebHTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the WebPeter Lubbers
 
HTML5 WebSocket for the Real-Time Web and the Internet of Things
HTML5 WebSocket for the Real-Time Weband the Internet of ThingsHTML5 WebSocket for the Real-Time Weband the Internet of Things
HTML5 WebSocket for the Real-Time Web and the Internet of ThingsPeter Moskovits
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossugclkao
 
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011Peter Moskovits
 
Websockets in Node.js - Making them reliable and scalable
Websockets in Node.js - Making them reliable and scalableWebsockets in Node.js - Making them reliable and scalable
Websockets in Node.js - Making them reliable and scalableGareth Marland
 
Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015
Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015
Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015Rich Cullen
 
Introduction to WebSockets Presentation
Introduction to WebSockets PresentationIntroduction to WebSockets Presentation
Introduction to WebSockets PresentationJulien LaPointe
 
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketV2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketbrent bucci
 
Building Living Web Applications with HTML5 WebSockets
Building Living Web Applications with HTML5 WebSocketsBuilding Living Web Applications with HTML5 WebSockets
Building Living Web Applications with HTML5 WebSocketsPeter Moskovits
 
SPDY - http reloaded - WebTechConference 2012
SPDY - http reloaded - WebTechConference 2012SPDY - http reloaded - WebTechConference 2012
SPDY - http reloaded - WebTechConference 2012Fabian Lange
 
Large scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socketLarge scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socketLe Kien Truc
 
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at ScaleJUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at ScaleC2B2 Consulting
 
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
WebSockets: The Current State of the Most Valuable HTML5 API for Java DevelopersWebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
WebSockets: The Current State of the Most Valuable HTML5 API for Java DevelopersViktor Gamov
 
Active Https Cookie Stealing
Active Https Cookie StealingActive Https Cookie Stealing
Active Https Cookie StealingSecurityTube.Net
 
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/CamelCamelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/CamelCharles Moulliard
 

What's hot (20)

Websocket protocol overview
Websocket protocol overviewWebsocket protocol overview
Websocket protocol overview
 
HTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the WebHTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the Web
 
Intro to WebSockets
Intro to WebSocketsIntro to WebSockets
Intro to WebSockets
 
HTML5 WebSocket for the Real-Time Web and the Internet of Things
HTML5 WebSocket for the Real-Time Weband the Internet of ThingsHTML5 WebSocket for the Real-Time Weband the Internet of Things
HTML5 WebSocket for the Real-Time Web and the Internet of Things
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossug
 
Php push notifications
Php push notificationsPhp push notifications
Php push notifications
 
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
 
Websockets in Node.js - Making them reliable and scalable
Websockets in Node.js - Making them reliable and scalableWebsockets in Node.js - Making them reliable and scalable
Websockets in Node.js - Making them reliable and scalable
 
J web socket
J web socketJ web socket
J web socket
 
Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015
Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015
Top 10 real life WebSocket use cases & experiences - Devoxx UK 2015
 
Introduction to WebSockets Presentation
Introduction to WebSockets PresentationIntroduction to WebSockets Presentation
Introduction to WebSockets Presentation
 
Kaazing
KaazingKaazing
Kaazing
 
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketV2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocket
 
Building Living Web Applications with HTML5 WebSockets
Building Living Web Applications with HTML5 WebSocketsBuilding Living Web Applications with HTML5 WebSockets
Building Living Web Applications with HTML5 WebSockets
 
SPDY - http reloaded - WebTechConference 2012
SPDY - http reloaded - WebTechConference 2012SPDY - http reloaded - WebTechConference 2012
SPDY - http reloaded - WebTechConference 2012
 
Large scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socketLarge scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socket
 
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at ScaleJUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
 
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
WebSockets: The Current State of the Most Valuable HTML5 API for Java DevelopersWebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
 
Active Https Cookie Stealing
Active Https Cookie StealingActive Https Cookie Stealing
Active Https Cookie Stealing
 
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/CamelCamelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
 

Viewers also liked

Intro lecture: Theory and method for media technology
Intro lecture: Theory and method for media technologyIntro lecture: Theory and method for media technology
Intro lecture: Theory and method for media technologyhrastinski
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSocketsWASdev Community
 
IoT - the Next Wave of DDoS Threat Landscape
IoT - the Next Wave of DDoS Threat LandscapeIoT - the Next Wave of DDoS Threat Landscape
IoT - the Next Wave of DDoS Threat LandscapeAPNIC
 
Honeypot honeynet
Honeypot honeynetHoneypot honeynet
Honeypot honeynetSina Manavi
 
AWS初心者向けWebinar AWS上でのDDoS対策
AWS初心者向けWebinar AWS上でのDDoS対策AWS初心者向けWebinar AWS上でのDDoS対策
AWS初心者向けWebinar AWS上でのDDoS対策Amazon Web Services Japan
 
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)Ericom Software
 

Viewers also liked (7)

Intro lecture: Theory and method for media technology
Intro lecture: Theory and method for media technologyIntro lecture: Theory and method for media technology
Intro lecture: Theory and method for media technology
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
 
IoT - the Next Wave of DDoS Threat Landscape
IoT - the Next Wave of DDoS Threat LandscapeIoT - the Next Wave of DDoS Threat Landscape
IoT - the Next Wave of DDoS Threat Landscape
 
Honeypot honeynet
Honeypot honeynetHoneypot honeynet
Honeypot honeynet
 
DDoS Attacks
DDoS AttacksDDoS Attacks
DDoS Attacks
 
AWS初心者向けWebinar AWS上でのDDoS対策
AWS初心者向けWebinar AWS上でのDDoS対策AWS初心者向けWebinar AWS上でのDDoS対策
AWS初心者向けWebinar AWS上でのDDoS対策
 
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
 

Similar to WebSocket protocol

Real-Time with Flowdock
Real-Time with FlowdockReal-Time with Flowdock
Real-Time with FlowdockFlowdock
 
Inside dropbox
Inside dropboxInside dropbox
Inside dropboxLINE+
 
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoTWebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoTFrank Greco
 
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...Edward Burns
 
Ubuntu server wireless access point (eng)
Ubuntu server wireless access point (eng)Ubuntu server wireless access point (eng)
Ubuntu server wireless access point (eng)Anatoliy Okhotnikov
 
WebSockets - Today, in the Past, in Future and in Production.
WebSockets - Today, in the Past, in Future and in Production.WebSockets - Today, in the Past, in Future and in Production.
WebSockets - Today, in the Past, in Future and in Production.bodokaiser
 
WebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the FutureWebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the FutureFrank Greco
 
Web sockets - Pentesting
Web sockets - Pentesting Web sockets - Pentesting
Web sockets - Pentesting Vandana Verma
 
D1-3-Signaling
D1-3-SignalingD1-3-Signaling
D1-3-SignalingOleg Levy
 
Web of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the WebWeb of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the WebDominique Guinard
 
Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevFelix Geisendörfer
 
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20Nathan O'Hanlon
 
Notes on a High-Performance JSON Protocol
Notes on a High-Performance JSON ProtocolNotes on a High-Performance JSON Protocol
Notes on a High-Performance JSON ProtocolDaniel Austin
 
StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackIQ
 
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012Arun Gupta
 

Similar to WebSocket protocol (20)

Real-Time with Flowdock
Real-Time with FlowdockReal-Time with Flowdock
Real-Time with Flowdock
 
Inside dropbox
Inside dropboxInside dropbox
Inside dropbox
 
111214 node conf
111214 node conf111214 node conf
111214 node conf
 
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoTWebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
 
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
 
Ubuntu server wireless access point (eng)
Ubuntu server wireless access point (eng)Ubuntu server wireless access point (eng)
Ubuntu server wireless access point (eng)
 
WebSockets - Today, in the Past, in Future and in Production.
WebSockets - Today, in the Past, in Future and in Production.WebSockets - Today, in the Past, in Future and in Production.
WebSockets - Today, in the Past, in Future and in Production.
 
WebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the FutureWebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the Future
 
spdy
spdyspdy
spdy
 
Web-Socket
Web-SocketWeb-Socket
Web-Socket
 
Web sockets - Pentesting
Web sockets - Pentesting Web sockets - Pentesting
Web sockets - Pentesting
 
D1-3-Signaling
D1-3-SignalingD1-3-Signaling
D1-3-Signaling
 
Web of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the WebWeb of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the Web
 
Ws
WsWs
Ws
 
Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredev
 
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
 
Web Fundamentals
Web FundamentalsWeb Fundamentals
Web Fundamentals
 
Notes on a High-Performance JSON Protocol
Notes on a High-Performance JSON ProtocolNotes on a High-Performance JSON Protocol
Notes on a High-Performance JSON Protocol
 
StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra
 
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
 

More from Kensaku Komatsu

Media processing with serverless architecture
Media processing with serverless architectureMedia processing with serverless architecture
Media processing with serverless architectureKensaku Komatsu
 
Full Matrix Auto Test Framework for WebRTC
Full Matrix Auto Test Framework for WebRTCFull Matrix Auto Test Framework for WebRTC
Full Matrix Auto Test Framework for WebRTCKensaku Komatsu
 
04122016 web rtc_globalsummit
04122016 web rtc_globalsummit04122016 web rtc_globalsummit
04122016 web rtc_globalsummitKensaku Komatsu
 
02172016 web rtc_conf_komasshu
02172016 web rtc_conf_komasshu02172016 web rtc_conf_komasshu
02172016 web rtc_conf_komasshuKensaku Komatsu
 
SkyWay国内唯一のCPaaS
SkyWay国内唯一のCPaaSSkyWay国内唯一のCPaaS
SkyWay国内唯一のCPaaSKensaku Komatsu
 
ラズパイでWebRTC ヾ(*´∀`*)ノキャッキャ uv4l-webrtc 軽くハックしてみたよ!
ラズパイでWebRTC ヾ(*´∀`*)ノキャッキャ    uv4l-webrtc 軽くハックしてみたよ!ラズパイでWebRTC ヾ(*´∀`*)ノキャッキャ    uv4l-webrtc 軽くハックしてみたよ!
ラズパイでWebRTC ヾ(*´∀`*)ノキャッキャ uv4l-webrtc 軽くハックしてみたよ!Kensaku Komatsu
 
ビデオ通話・P2Pがコモディティ化する世界 WebRTCによるこれからを探る
ビデオ通話・P2Pがコモディティ化する世界 WebRTCによるこれからを探るビデオ通話・P2Pがコモディティ化する世界 WebRTCによるこれからを探る
ビデオ通話・P2Pがコモディティ化する世界 WebRTCによるこれからを探るKensaku Komatsu
 
最新Web 通信系API総まくり!WebRTC, Streams, Push api etc.
最新Web 通信系API総まくり!WebRTC, Streams, Push api etc.最新Web 通信系API総まくり!WebRTC, Streams, Push api etc.
最新Web 通信系API総まくり!WebRTC, Streams, Push api etc.Kensaku Komatsu
 
14th apr2015 リックテレコ勉強会
14th apr2015 リックテレコ勉強会14th apr2015 リックテレコ勉強会
14th apr2015 リックテレコ勉強会Kensaku Komatsu
 
WebRTCが拓く 新たなWebビジネスの世界
WebRTCが拓く新たなWebビジネスの世界WebRTCが拓く新たなWebビジネスの世界
WebRTCが拓く 新たなWebビジネスの世界Kensaku Komatsu
 
Web of Thingsの現状とWebRTC活用の可能性
Web of Thingsの現状とWebRTC活用の可能性Web of Thingsの現状とWebRTC活用の可能性
Web of Thingsの現状とWebRTC活用の可能性Kensaku Komatsu
 
知ってると得するかもしれないConstraintsたち
知ってると得するかもしれないConstraintsたち知ってると得するかもしれないConstraintsたち
知ってると得するかもしれないConstraintsたちKensaku Komatsu
 
WebRTCにより可視化されるリアルタイムクラウド。求められるAPI
WebRTCにより可視化されるリアルタイムクラウド。求められるAPI WebRTCにより可視化されるリアルタイムクラウド。求められるAPI
WebRTCにより可視化されるリアルタイムクラウド。求められるAPI Kensaku Komatsu
 
エフサミ2014 web rtcの傾向と対策
エフサミ2014 web rtcの傾向と対策エフサミ2014 web rtcの傾向と対策
エフサミ2014 web rtcの傾向と対策Kensaku Komatsu
 
HTML5 Night 2014 Web x Network Technology ( WebRTC )
HTML5 Night 2014 Web x Network Technology ( WebRTC )HTML5 Night 2014 Web x Network Technology ( WebRTC )
HTML5 Night 2014 Web x Network Technology ( WebRTC )Kensaku Komatsu
 

More from Kensaku Komatsu (20)

Media processing with serverless architecture
Media processing with serverless architectureMedia processing with serverless architecture
Media processing with serverless architecture
 
Boxdev lt-09082016
Boxdev lt-09082016Boxdev lt-09082016
Boxdev lt-09082016
 
a pattern for PWA, PRPL
a pattern for PWA, PRPLa pattern for PWA, PRPL
a pattern for PWA, PRPL
 
Full Matrix Auto Test Framework for WebRTC
Full Matrix Auto Test Framework for WebRTCFull Matrix Auto Test Framework for WebRTC
Full Matrix Auto Test Framework for WebRTC
 
WebRTC 101
WebRTC 101WebRTC 101
WebRTC 101
 
04122016 web rtc_globalsummit
04122016 web rtc_globalsummit04122016 web rtc_globalsummit
04122016 web rtc_globalsummit
 
02172016 web rtc_conf_komasshu
02172016 web rtc_conf_komasshu02172016 web rtc_conf_komasshu
02172016 web rtc_conf_komasshu
 
SkyWay国内唯一のCPaaS
SkyWay国内唯一のCPaaSSkyWay国内唯一のCPaaS
SkyWay国内唯一のCPaaS
 
ラズパイでWebRTC ヾ(*´∀`*)ノキャッキャ uv4l-webrtc 軽くハックしてみたよ!
ラズパイでWebRTC ヾ(*´∀`*)ノキャッキャ    uv4l-webrtc 軽くハックしてみたよ!ラズパイでWebRTC ヾ(*´∀`*)ノキャッキャ    uv4l-webrtc 軽くハックしてみたよ!
ラズパイでWebRTC ヾ(*´∀`*)ノキャッキャ uv4l-webrtc 軽くハックしてみたよ!
 
ビデオ通話・P2Pがコモディティ化する世界 WebRTCによるこれからを探る
ビデオ通話・P2Pがコモディティ化する世界 WebRTCによるこれからを探るビデオ通話・P2Pがコモディティ化する世界 WebRTCによるこれからを探る
ビデオ通話・P2Pがコモディティ化する世界 WebRTCによるこれからを探る
 
最新Web 通信系API総まくり!WebRTC, Streams, Push api etc.
最新Web 通信系API総まくり!WebRTC, Streams, Push api etc.最新Web 通信系API総まくり!WebRTC, Streams, Push api etc.
最新Web 通信系API総まくり!WebRTC, Streams, Push api etc.
 
FirefoxでgetStats()
FirefoxでgetStats()FirefoxでgetStats()
FirefoxでgetStats()
 
14th apr2015 リックテレコ勉強会
14th apr2015 リックテレコ勉強会14th apr2015 リックテレコ勉強会
14th apr2015 リックテレコ勉強会
 
WebRTCが拓く 新たなWebビジネスの世界
WebRTCが拓く新たなWebビジネスの世界WebRTCが拓く新たなWebビジネスの世界
WebRTCが拓く 新たなWebビジネスの世界
 
Web of Thingsの現状とWebRTC活用の可能性
Web of Thingsの現状とWebRTC活用の可能性Web of Thingsの現状とWebRTC活用の可能性
Web of Thingsの現状とWebRTC活用の可能性
 
25th nov2014 52thhtml5j
25th nov2014 52thhtml5j25th nov2014 52thhtml5j
25th nov2014 52thhtml5j
 
知ってると得するかもしれないConstraintsたち
知ってると得するかもしれないConstraintsたち知ってると得するかもしれないConstraintsたち
知ってると得するかもしれないConstraintsたち
 
WebRTCにより可視化されるリアルタイムクラウド。求められるAPI
WebRTCにより可視化されるリアルタイムクラウド。求められるAPI WebRTCにより可視化されるリアルタイムクラウド。求められるAPI
WebRTCにより可視化されるリアルタイムクラウド。求められるAPI
 
エフサミ2014 web rtcの傾向と対策
エフサミ2014 web rtcの傾向と対策エフサミ2014 web rtcの傾向と対策
エフサミ2014 web rtcの傾向と対策
 
HTML5 Night 2014 Web x Network Technology ( WebRTC )
HTML5 Night 2014 Web x Network Technology ( WebRTC )HTML5 Night 2014 Web x Network Technology ( WebRTC )
HTML5 Night 2014 Web x Network Technology ( WebRTC )
 

Recently uploaded

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Recently uploaded (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

WebSocket protocol

  • 1. Yet another html5j meetup on July 5th, 2012 WEBSOCKET PROTOCOL http://goo.gl/0kJGW 2012/7/5(THU) KENSAKU KOMATSU
  • 2. SELF-INTRODUCTION • Researching cutting-edge web technology • Especially APIs related to NW, in preference  • Google API Expert (HTML5) • Microsoft Most Valuable Professional(IE) • Twitter: @komasshu • Blog: http://blog.livedoor.jp/kotesaki
  • 3. ACTIVITIES http://www.html5rocks.com/en/tutorials/speed/quick/ (I LOVE SPEED!!) Referred!!, But… orz (I know I should do feedback) http://wakachi.komasshu.info/
  • 4. TODAY’S MAIN IDEA Two topics 1. Introduction to WebSocket and SPDY 2. Dive into WebSocket Protocol.
  • 6. EVOLVINGOF WEB SERVICES 1991 2012 http://www.ibarakiken.gr.jp/www/index.html http://www.ocn.ne.jp/ https://www.facebook.com/
  • 7. COMMUNICATION MODEL HAS BEEN CHANGED 1991 2012 http://www.ibarakiken.gr.jp/www/index.html http://www.ocn.ne.jp/ https://www.facebook.com/ Multiple resources Single resource + Multiple resources Bi-directional
  • 8. TRANSPORT PROTOCOLHAS NOT CHANGED REQUEST GET index.html RESPONSE REQUEST GET style.css RESPONSE
  • 9. ISSUESINHTTP Slowinmultiple resources Periodically polling hello! “hello”
  • 10. CURRENT PRACTICE FOR SOLVING ISSUES Concurrent tcp connections Long Polling hello! “hello”
  • 11. BUT STILL… • Concurrent tcp request • Increase server load • Heavy loadto intermediary • e.g. NAT, proxy, FireWall… • Long polling • Complicated coding • Increase traffics • Header: k – 10k order • Payload : 10 bytes order …
  • 12. CUTTING EDGE PROTOCOLS SPDY, WEBSOCKET SPDY WebSocket ・Enable bidirectional communication wo/ restrictions. (request not needed) ・Header overhead is hello! extremely small. ・Multiplex request Under single https “hello” connection.
  • 13. PROTOCOL STACKS SPDY WebSocket SPDY (HTTP layer) Any protocols SPDY (framing layer) WebSocket TLS TLS TCP TCP SSBP will be applied here?
  • 14. A COMPARATIVE TABLE SPDY WebSocket Goal reduce the latency of web provide two-way pages communication to browser- based application How to setup 1. apply patch/module to 1. setup middleware your middleware 2. write server side programming 3. write client side javascript Migration very easy expensive Coding skill not required  mandatory What we can Fast while downloading web Anything (especially bi- serve? resources. directional webapps (e.g. chat, push services, online game ))
  • 15. TOPIC2: Dive into WebSocket Protocol http://www.flickr.com/photos/nektar/6085553520/sizes/z/in/photostream/
  • 16. DEMO:MULTI DEVICE WebIntents + INTERACTION ServiceDiscovery (uPnP) WebSocket
  • 17. DEMO: COMPARATIVE TEST (WS VS HTTP) http://refws.komasshu.info/echocompare.html
  • 18. REF: CASE HTTP // send request $.get(“http://example.com”, function(data, e) { // when data is received console.log(data); }); To receive data, sending request must be required.
  • 19. HOW TO USE WEBSOCKET? (BROWSER SIDE API) // initiate connection varws = new WebSocket(“ws://example.com/”); // right after connection established ws.onconnect = function(e) { ... }; // when data arrival from server ws.onmessage = function(e) { console.log(e.data); } // send data to server ws.send(“hello”); // close connection ws.close(); sending and receiving data works independently.
  • 20. PROTOCOL OVERVIEW The WebSocketProtocol (RFC6455) •Has two parts • handshake • in context of HTTP/1.1 • data transfer • frame format •protocol schema • ws (80), wss(443) •browsers • chrome, firefox, safari, opera(need configuration), IE10 • iOS safari, Android browser (Chrome)
  • 21. SEQUENCE OVERVIEW handshake data transfer closing
  • 22. HANDSHAKE client to server server to client
  • 23. DATA FRAMING indicates text, binary, ping, pong, close ... Payload data is masked with Masking-key (XOR base) (preventing Firewall Circumvention & Cache Poisoning)
  • 24. WHAT FOR PING/PONG? Under no-traffic, intermediaries release session table Load Fire NAT Balan Wall cer websocket connection Known as “silent close”.
  • 25. WHAT FOR PING/PONG? [CONT] Load ping Fire NAT Balan pong Wall cer websocket connection ping & pong is used to prevent silent close (Keep-alive)
  • 26. ADDITIONAL INFO CGN IN MOBILE NW CGN is already installed into almost all mobile career NW. So using ping/pong is necessary (also thinking about battery issues). G Career Grade NAT P P P P IPv4 Private address NW
  • 27. GETTING REACH ABILITY Treat WS traffic as HTTP/1.1 ⇨ Data framing will blocked ;-( Load Fire proxy Balan Wall cer websocket connection Use WSS (prevent interruption)
  • 28. SUBPROTOCOL •WebSocket can handle any data schema. • example: transfer mouse coordinates • option1 : {x: 1, y:240} • option2 : [1, 240] • option3 : {x: “1px”, y: “240px”} • ...... lack of interoperability •subprotocol addresses the interoperability problem • define schema, sequence, ... • should register IANA • identifier, common name, definition
  • 29. SUBPROTOCOL[CONT] http://www.iana.org/assignments/websocket/websocket.xml
  • 30. EXTENSION Two proposal are now discussed. •Multiplexing Extension • http://tools.ietf.org/html/draft-ietf-hybi-websocket-multiplexing- 03 •Per-frame Compression • http://tools.ietf.org/html/draft-ietf-hybi-websocket-perframe- compression-04
  • 31. SOCKET.IO Automatically fallback from WebSocket to Comet. Automatic keep-alive, name space, ... very convenient!! http://socket.io/
  • 32. FOR SCALABLE SERVICES redis, mongoDB, ... sync status / message sharing WS WS WS WS server server server server node-proxy Load balancer some persistency nginx(work in progress) will required (source IP hash, user access cookie ...)
  • 33. CONCLUSION •WebSocket • provide two-way communication to browser-based application • NO request & response restrictions • default port is 80 (ws), 443(wss) • consists of two parts • handshake : upgrade mechanism • data transfer : text (utf-8) and binary • ping/pong • prevent silent close • wss • get reach ability • subprotocol • interoperability • extensions • multiplexing, per-frame compression