SlideShare uma empresa Scribd logo
1 de 43
Baixar para ler offline
WebSocket
              2011/08/15   @




11   8   15
Push/Push Like



11   8   15
Push/Push Like

              XMLHttpRequest (Ajax:           )

              Comet (Long Polling     Push)

              Flash (Action Script       )

              iframe          (



11   8   15
WebSocket




11   8   15
WebSocket
              W3C IETF

              XMLHttpRequest                Comet

              TCP

                    HTML5

              API

              http://dev.w3.org/html5/websockets/


11   8   15
WebSocket

               Web         TCP

                             HTTP

                                   TCP

              URI         HTTP

                “ws://” ”wss://”


11   8   15
Ajax, Comet


                          Polling




              http://prog.re-d.net/demo/slide/20110528/
11   8   15
WebSocket




              http://prog.re-d.net/demo/slide/20110528/
11   8   15
HTTP




11   8   15
Ajax, Comet


              ->




              ->



11   8   15
Client API




11   8   15
API
              var ws = new WebSocket("ws://example.com/service");

              ws.onopen = function() {
                // Web Socket is connected. You can send data by send() method.
                ws.send("message to send"); ....
              };

              ws.onmessage = function (evt) { var received_msg = evt.data; ... };

              ws.onclose = function() { // websocket is closed. };




                                          http://dev.w3.org/html5/websockets/


11   8   15
Server   Handshake




11   8   15
->
                                                ※                           HTTP
              GET /demo HTTP/1.1
              Host: example.com
              Connection: Upgrade
              Sec-WebSocket-Key2: 12998 5 Y3 1 .P00
              Sec-WebSocket-Protocol: sample
              Upgrade: WebSocket
              Sec-WebSocket-Key1: 4 @1 46546xW%0l 1 5
              Origin: http://example.com

              ^n:ds[4U


                    ->
              HTTP/1.1 101 WebSocket Protocol Handshake
              Upgrade: WebSocket
              Connection: Upgrade
              Sec-WebSocket-Origin: http://example.com
              Sec-WebSocket-Location: ws://example.com/demo   Key1, Key2,          MD5
              Sec-WebSocket-Protocol: sample

              8jKS'y:G*Co,Wxa-



11   8   15
&

              Challenge & Response
                    &




                    &




                                                                                &



              http://www.sophia-it.com/content/%E3%83%81%E3%83%A3%E3%83%AC%E3%83%B3%E3%82%B8%26%E3%83%AC%E3%82%B9%E3%83%9D%E3%83%B3%E3%82%B9%E6%96%B9%E5%BC%8F




11   8   15
1



                  0x00[Data]0xFF




              ※




11   8   15
Google
              Ian Hickson editor of HTML5 specification

              Reducing kilobytes of data to 2 bytes…and reducing latency
              from 150ms to 50ms is far more than marginal. In fact, these
              two factors alone are enough to make WebSocket seriously
              interesting to Google.

                                                      2           150ms
                  50ms
                                                2
              WebSocket   Google



11   8   15
WebSocket




11   8   15
PC

                   Chrome4     /Safari5        OK

                   Opera,Firefox                Off

                   IE




                   iOS 4.2.1    Safari    OK

                   android           (webkit          )



11   8   15
node.js

                 socket.io

                        WebSocket   Flash Jsonp   XHR



              Java

                 Play!

                 Jetty

                 Grizzly



11   8   15
Perl
                  Mojolicious
                       Catalyst   FW

              Ruby
                  em-websocket
              Python
                  pywebsocket
              C
                  mod_websocket
                       lighttpd

11   8   15
Kaazing

                             Java   .NET



              Pusher

                REST API
                WebSocket   push




11   8   15
11   8   15
11   8   15
http://dev.w3.org/html5/websockets/

                                             7

                W3C

                      WebSocket




11   8   15
http://dev.w3.org/html5/websockets/

                                             7

                W3C

                      WebSocket




                       Σ( Д                         !
11   8   15
WebSocket




11   8   15
11   8   15
11   8   15
11   8   15
Socket.io




11   8   15
Socket.io




11   8   15
Socket.io
              WebSocket+α

                     node.js

              Push

                       http://socket.io/

                        https://github.com/LearnBoost/socket.io

                     https://github.com/LearnBoost/socket.io-spec


11   8   15
WebSocket

              Flash

              Ajax long polling

              Ajax multipart polling

              Forever iframe

              JSONP polling



11   8   15
IE5.5        iPhone Safari

                           iPad Safari
              Safari3
                           Android Webkit
              Chrome3
                           WebOS Webkit
              Firefox3

              Opera10.61



11   8   15
IE5.5        iPhone Safari

                           iPad Safari
              Safari3
                           Android Webkit
              Chrome3
                           WebOS Webkit
              Firefox3

              Opera10.61



11   8   15
WebSocket




11   8   15
node.js

                          Javascript

              Google V8

                              I/O




11   8   15
11   8   15
http://d.hatena.ne.jp/ikeike443/20110808




11   8   15
11   8   15
Push




11   8   15
11   8   15

Mais conteúdo relacionado

Mais procurados

Advances in BeEF - AthCon2012
Advances in BeEF - AthCon2012Advances in BeEF - AthCon2012
Advances in BeEF - AthCon2012
Michele Orru
 
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
Viktor Gamov
 
vlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets Presentationvlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets Presentation
Volodymyr Lavrynovych
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossug
clkao
 

Mais procurados (20)

WebSockets On Fire
WebSockets On FireWebSockets On Fire
WebSockets On Fire
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
 
Websockets
WebsocketsWebsockets
Websockets
 
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
 
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/CamelCamelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
 
Advances in BeEF - AthCon2012
Advances in BeEF - AthCon2012Advances in BeEF - AthCon2012
Advances in BeEF - AthCon2012
 
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
 
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.
 
Be ef presentation-securitybyte2011-michele_orru
Be ef presentation-securitybyte2011-michele_orruBe ef presentation-securitybyte2011-michele_orru
Be ef presentation-securitybyte2011-michele_orru
 
HTTPS and HTTP/2
HTTPS and HTTP/2HTTPS and HTTP/2
HTTPS and HTTP/2
 
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)
 
DevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSocketsDevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSockets
 
Google Chromebook for the Enterprise: Yeah or Meh?
Google Chromebook for the Enterprise: Yeah or Meh?Google Chromebook for the Enterprise: Yeah or Meh?
Google Chromebook for the Enterprise: Yeah or Meh?
 
Browser Exploitation Framework Tutorial
Browser Exploitation Framework TutorialBrowser Exploitation Framework Tutorial
Browser Exploitation Framework Tutorial
 
vlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets Presentationvlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets Presentation
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossug
 
J web socket
J web socketJ web socket
J web socket
 
Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014
 
14. html 5 security considerations
14. html 5 security considerations14. html 5 security considerations
14. html 5 security considerations
 
Building Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using WebsocketsBuilding Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using Websockets
 

Destaque

Play勉強会 playをGAEで動かそう!
Play勉強会 playをGAEで動かそう!Play勉強会 playをGAEで動かそう!
Play勉強会 playをGAEで動かそう!
Daisuke Kasuya
 
Nettyらへん
NettyらへんNettyらへん
Nettyらへん
Go Tanaka
 
Smart City ICT
Smart City ICTSmart City ICT
Smart City ICT
Paul Goff
 
Ning site documentary films
Ning site documentary filmsNing site documentary films
Ning site documentary films
jessicam0101
 
Texting While Driving
Texting  While  DrivingTexting  While  Driving
Texting While Driving
bonitadreama
 
IEC Do's & Don'ts
IEC  Do's & Don'tsIEC  Do's & Don'ts
IEC Do's & Don'ts
iec
 
[plan politika] Indonesian Youth Movement Nowadays : In Memory of May, 1998
[plan politika] Indonesian Youth Movement Nowadays : In Memory of May, 1998 [plan politika] Indonesian Youth Movement Nowadays : In Memory of May, 1998
[plan politika] Indonesian Youth Movement Nowadays : In Memory of May, 1998
Plan Politika
 
(Plan Politika) Female Youthpedia
(Plan Politika) Female Youthpedia(Plan Politika) Female Youthpedia
(Plan Politika) Female Youthpedia
Plan Politika
 

Destaque (20)

Play ja kansai
Play ja kansaiPlay ja kansai
Play ja kansai
 
CEDEC2015講演 チーム開発をスムーズにするために
CEDEC2015講演 チーム開発をスムーズにするためにCEDEC2015講演 チーム開発をスムーズにするために
CEDEC2015講演 チーム開発をスムーズにするために
 
Play勉強会 playをGAEで動かそう!
Play勉強会 playをGAEで動かそう!Play勉強会 playをGAEで動かそう!
Play勉強会 playをGAEで動かそう!
 
Nettyらへん
NettyらへんNettyらへん
Nettyらへん
 
Smart City ICT
Smart City ICTSmart City ICT
Smart City ICT
 
Ramas de la biologia
Ramas de la biologiaRamas de la biologia
Ramas de la biologia
 
C:\Documents And Settings\User\My Documents\My Pictures\Drakestergabypeace An...
C:\Documents And Settings\User\My Documents\My Pictures\Drakestergabypeace An...C:\Documents And Settings\User\My Documents\My Pictures\Drakestergabypeace An...
C:\Documents And Settings\User\My Documents\My Pictures\Drakestergabypeace An...
 
1. overcoming facebook marketing myths
1. overcoming facebook marketing myths1. overcoming facebook marketing myths
1. overcoming facebook marketing myths
 
Ning site documentary films
Ning site documentary filmsNing site documentary films
Ning site documentary films
 
Debugging Hung Python Processes With GDB
Debugging Hung Python Processes With GDBDebugging Hung Python Processes With GDB
Debugging Hung Python Processes With GDB
 
SJob
SJobSJob
SJob
 
[plan politika] Indonesian Youth and Politics : Jakarta's Youth Aspiration pa...
[plan politika] Indonesian Youth and Politics : Jakarta's Youth Aspiration pa...[plan politika] Indonesian Youth and Politics : Jakarta's Youth Aspiration pa...
[plan politika] Indonesian Youth and Politics : Jakarta's Youth Aspiration pa...
 
Pds2005
Pds2005Pds2005
Pds2005
 
Texting While Driving
Texting  While  DrivingTexting  While  Driving
Texting While Driving
 
IEC Do's & Don'ts
IEC  Do's & Don'tsIEC  Do's & Don'ts
IEC Do's & Don'ts
 
áLbum de fotografías
áLbum de fotografíasáLbum de fotografías
áLbum de fotografías
 
Tidak layak ke syurga mu
Tidak layak ke syurga muTidak layak ke syurga mu
Tidak layak ke syurga mu
 
[plan politika] Indonesian Youth Movement Nowadays : In Memory of May, 1998
[plan politika] Indonesian Youth Movement Nowadays : In Memory of May, 1998 [plan politika] Indonesian Youth Movement Nowadays : In Memory of May, 1998
[plan politika] Indonesian Youth Movement Nowadays : In Memory of May, 1998
 
(Plan Politika) Female Youthpedia
(Plan Politika) Female Youthpedia(Plan Politika) Female Youthpedia
(Plan Politika) Female Youthpedia
 
Marta
MartaMarta
Marta
 

Semelhante a Websocket shanon

Dev con kolkata 2012 websockets
Dev con kolkata 2012   websocketsDev con kolkata 2012   websockets
Dev con kolkata 2012 websockets
SANKARSAN BOSE
 
Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010
sullis
 
Hello websocket(cn)
Hello websocket(cn)Hello websocket(cn)
Hello websocket(cn)
g65537
 
Codecamp iasi-26 nov 2011-web sockets
Codecamp iasi-26 nov 2011-web socketsCodecamp iasi-26 nov 2011-web sockets
Codecamp iasi-26 nov 2011-web sockets
Codecamp Romania
 

Semelhante a Websocket shanon (20)

WebSocketでリアルタイム通信
WebSocketでリアルタイム通信WebSocketでリアルタイム通信
WebSocketでリアルタイム通信
 
110828recruit agent ws
110828recruit agent ws110828recruit agent ws
110828recruit agent ws
 
WebSocket Server - Jul 2010
WebSocket Server - Jul 2010WebSocket Server - Jul 2010
WebSocket Server - Jul 2010
 
What is play
What is playWhat is play
What is play
 
Dev con kolkata 2012 websockets
Dev con kolkata 2012   websocketsDev con kolkata 2012   websockets
Dev con kolkata 2012 websockets
 
Ws
WsWs
Ws
 
The HTML5 WebSocket API
The HTML5 WebSocket APIThe HTML5 WebSocket API
The HTML5 WebSocket API
 
Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010
 
Jwebsocketmobiletechcon2010en 100912071225 Phpapp01
Jwebsocketmobiletechcon2010en 100912071225 Phpapp01Jwebsocketmobiletechcon2010en 100912071225 Phpapp01
Jwebsocketmobiletechcon2010en 100912071225 Phpapp01
 
jWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerry
jWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerryjWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerry
jWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerry
 
Realizzare applicazioni Web con WebSocket, by Simone Bordet
Realizzare applicazioni Web con WebSocket, by Simone BordetRealizzare applicazioni Web con WebSocket, by Simone Bordet
Realizzare applicazioni Web con WebSocket, by Simone Bordet
 
URL Design
URL DesignURL Design
URL Design
 
Hello websocket(cn)
Hello websocket(cn)Hello websocket(cn)
Hello websocket(cn)
 
Websocket
WebsocketWebsocket
Websocket
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
Codecamp iasi-26 nov 2011-web sockets
Codecamp iasi-26 nov 2011-web socketsCodecamp iasi-26 nov 2011-web sockets
Codecamp iasi-26 nov 2011-web sockets
 
Codecamp Iasi-26 nov 2011 - Html 5 WebSockets
Codecamp Iasi-26 nov 2011 - Html 5 WebSocketsCodecamp Iasi-26 nov 2011 - Html 5 WebSockets
Codecamp Iasi-26 nov 2011 - Html 5 WebSockets
 
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San FranciscoHTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
 
Connected Web Systems
Connected Web SystemsConnected Web Systems
Connected Web Systems
 
Introduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and SilverlightIntroduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and Silverlight
 

Mais de Takafumi Ikeda (7)

Dev love kansai
Dev love kansaiDev love kansai
Dev love kansai
 
チーム開発をスムーズにするために何ができるか
チーム開発をスムーズにするために何ができるかチーム開発をスムーズにするために何ができるか
チーム開発をスムーズにするために何ができるか
 
Scala conf2013
Scala conf2013Scala conf2013
Scala conf2013
 
Play ja 3_update
Play ja 3_updatePlay ja 3_update
Play ja 3_update
 
Play jjug2012spring
Play jjug2012springPlay jjug2012spring
Play jjug2012spring
 
Shibutra ikeike443
Shibutra ikeike443Shibutra ikeike443
Shibutra ikeike443
 
Jenkins+Play!で気軽にCI
Jenkins+Play!で気軽にCIJenkins+Play!で気軽にCI
Jenkins+Play!で気軽にCI
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 

Websocket shanon

  • 1. WebSocket 2011/08/15 @ 11 8 15
  • 3. Push/Push Like XMLHttpRequest (Ajax: ) Comet (Long Polling Push) Flash (Action Script ) iframe ( 11 8 15
  • 5. WebSocket W3C IETF XMLHttpRequest Comet TCP HTML5 API http://dev.w3.org/html5/websockets/ 11 8 15
  • 6. WebSocket Web TCP HTTP TCP URI HTTP “ws://” ”wss://” 11 8 15
  • 7. Ajax, Comet Polling http://prog.re-d.net/demo/slide/20110528/ 11 8 15
  • 8. WebSocket http://prog.re-d.net/demo/slide/20110528/ 11 8 15
  • 9. HTTP 11 8 15
  • 10. Ajax, Comet -> -> 11 8 15
  • 12. API var ws = new WebSocket("ws://example.com/service"); ws.onopen = function() { // Web Socket is connected. You can send data by send() method. ws.send("message to send"); .... }; ws.onmessage = function (evt) { var received_msg = evt.data; ... }; ws.onclose = function() { // websocket is closed. }; http://dev.w3.org/html5/websockets/ 11 8 15
  • 13. Server Handshake 11 8 15
  • 14. -> ※ HTTP GET /demo HTTP/1.1 Host: example.com Connection: Upgrade Sec-WebSocket-Key2: 12998 5 Y3 1 .P00 Sec-WebSocket-Protocol: sample Upgrade: WebSocket Sec-WebSocket-Key1: 4 @1 46546xW%0l 1 5 Origin: http://example.com ^n:ds[4U -> HTTP/1.1 101 WebSocket Protocol Handshake Upgrade: WebSocket Connection: Upgrade Sec-WebSocket-Origin: http://example.com Sec-WebSocket-Location: ws://example.com/demo Key1, Key2, MD5 Sec-WebSocket-Protocol: sample 8jKS'y:G*Co,Wxa- 11 8 15
  • 15. & Challenge & Response & & & http://www.sophia-it.com/content/%E3%83%81%E3%83%A3%E3%83%AC%E3%83%B3%E3%82%B8%26%E3%83%AC%E3%82%B9%E3%83%9D%E3%83%B3%E3%82%B9%E6%96%B9%E5%BC%8F 11 8 15
  • 16. 1 0x00[Data]0xFF ※ 11 8 15
  • 17. Google Ian Hickson editor of HTML5 specification Reducing kilobytes of data to 2 bytes…and reducing latency from 150ms to 50ms is far more than marginal. In fact, these two factors alone are enough to make WebSocket seriously interesting to Google. 2 150ms 50ms 2 WebSocket Google 11 8 15
  • 18. WebSocket 11 8 15
  • 19. PC Chrome4 /Safari5 OK Opera,Firefox Off IE iOS 4.2.1 Safari OK android (webkit ) 11 8 15
  • 20. node.js socket.io WebSocket Flash Jsonp XHR Java Play! Jetty Grizzly 11 8 15
  • 21. Perl Mojolicious Catalyst FW Ruby em-websocket Python pywebsocket C mod_websocket lighttpd 11 8 15
  • 22. Kaazing Java .NET Pusher REST API WebSocket push 11 8 15
  • 23. 11 8 15
  • 24. 11 8 15
  • 25. http://dev.w3.org/html5/websockets/ 7 W3C WebSocket 11 8 15
  • 26. http://dev.w3.org/html5/websockets/ 7 W3C WebSocket Σ( Д ! 11 8 15
  • 27. WebSocket 11 8 15
  • 28. 11 8 15
  • 29. 11 8 15
  • 30. 11 8 15
  • 31. Socket.io 11 8 15
  • 32. Socket.io 11 8 15
  • 33. Socket.io WebSocket+α node.js Push http://socket.io/ https://github.com/LearnBoost/socket.io https://github.com/LearnBoost/socket.io-spec 11 8 15
  • 34. WebSocket Flash Ajax long polling Ajax multipart polling Forever iframe JSONP polling 11 8 15
  • 35. IE5.5 iPhone Safari iPad Safari Safari3 Android Webkit Chrome3 WebOS Webkit Firefox3 Opera10.61 11 8 15
  • 36. IE5.5 iPhone Safari iPad Safari Safari3 Android Webkit Chrome3 WebOS Webkit Firefox3 Opera10.61 11 8 15
  • 37. WebSocket 11 8 15
  • 38. node.js Javascript Google V8 I/O 11 8 15
  • 39. 11 8 15
  • 41. 11 8 15
  • 42. Push 11 8 15
  • 43. 11 8 15