SlideShare une entreprise Scribd logo
1  sur  64
pushing the web forward
                          socket.io
                       with


Friday, April 6, 12
who am i
                      a socket.io core developer
                      winner node knockout 2011
                      early node user since 0.1.3

                         founder observe.it
Friday, April 6, 12
github    @3rd-eden
                                   &
                                @3rdeden
                      twitter




Friday, April 6, 12
i the state of real-time
                       ii socket.io
                      iii socket.io next


Friday, April 6, 12
the state of real-time


Friday, April 6, 12
the past


Friday, April 6, 12
the past
           comet, polling and other methods to abuse the web



                                 can i has data




                      browser                     server

Friday, April 6, 12
the past
           comet, polling and other methods to abuse the web



                                    can i has data

                                nope, dun has dataz ;(




                      browser                            server

Friday, April 6, 12
the past
           comet, polling and other methods to abuse the web



                                     can i has data

                                 nope, dun has dataz ;(

                                can i has data pretty plx




                      browser                               server

Friday, April 6, 12
the past
           comet, polling and other methods to abuse the web



                                     can i has data

                                 nope, dun has dataz ;(

                                can i has data pretty plx

                                   yes, i has ur dataz




                      browser                               server

Friday, April 6, 12
the past
           comet, polling and other methods to abuse the web



                                     can i has data

                                 nope, dun has dataz ;(

                                can i has data pretty plx

                                   yes, i has ur dataz

                                   ohi can i has dataz


                      browser                               server

Friday, April 6, 12
the past
                                   used transport methods



                      XHR & JSONP polling
                      can be used cross domain, JSONP connections usually use
                      an iframe to post messages




Friday, April 6, 12
the past
                                   used transport methods



                      iFrame / HTMLFile streaming
                      HTMLFile is used to hide the loading indicators as the connection with server is
                      never closed so it can stream in new messages




Friday, April 6, 12
the past
                                   used transport methods



                      Plugins, Java, Flash, Silverlight
                      everybody has this awesome bloatware installed




Friday, April 6, 12
the past
                                  used transport methods



                      EventSource and multipart XHR
                      EventSource was actually implemented in opera 9 and combined with XHR
                      multi-part from firefox we got two good streaming read only solutions




Friday, April 6, 12
the past
                                   used transport methods



                      window.name
                      used to create cross-domain browser transport, first used in Dojo




Friday, April 6, 12
HTML5   the future


Friday, April 6, 12
websockets
                      the good parts ™


Friday, April 6, 12
™ the good parts ™

                           Bidirectional




Friday, April 6, 12
™ the good parts ™

                           Bidirectional
                            Persistent




Friday, April 6, 12
™ the good parts ™

                           Bidirectional
                            Persistent
                           Light weight




Friday, April 6, 12
™ the good parts ™

                           Bidirectional
                            Persistent
                           Light weight
                            Blazing fast




Friday, April 6, 12
websockets
                      the bad parts ™


Friday, April 6, 12
™ the bad parts ™

                      No full browser coverage




Friday, April 6, 12
™ the bad parts ™

                      No full browser coverage
                           Browser issues




Friday, April 6, 12
™ the bad parts ™

                      No full browser coverage
                           Browser issues
                       Connection blockage




Friday, April 6, 12
™ the bad parts ™

                         No full browser coverage
                              Browser issues
                           Connection blockage
                      Bad server HTTP proxy support




Friday, April 6, 12
™ the bad parts ™
                            no full browser support yet



                      16+         8+       11.6+          5+      10+
                      RFC         RFC        HIXIE        HIXIE   RFC




Friday, April 6, 12
™ the bad parts ™
                         browser issues




Friday, April 6, 12
™ the bad parts ™
                                          browser issues


                      Usage or detecting a HTTP proxy
                      (AutoProxyDiscovery) crashes < Safari 5.1.4
                      and Mobile Webkit
                      your fucked or use user agent sniffing




Friday, April 6, 12
™ the bad parts ™
                                           browser issues



                      Writing to a closed WebSocket connection
                      can crash the browser & tabs
                      check for connection state with a setTimeout




Friday, April 6, 12
™ the bad parts ™
                                            browser issues



                      3G connections can crash WebSocket
                      fucked, again, disable websockets on portable devices, until netinfo API is
                      supported




Friday, April 6, 12
™ the bad parts ™
                                             browser issues


                      Pressing ESC in Firefox will drop the
                      established connection. Even after the page
                      has fully loaded.
                      capture the event early and try to cancel it




Friday, April 6, 12
™ the bad parts ™
                                          browser issues



                      Sending invalid UTF-8 drops the connection
                      escape & encodeURI your data




Friday, April 6, 12
™ the bad parts ™
                                            browser issues



                      TCP socket leaks in Chrome if you get
                      disconnected from the internet
                      you’re fucked, no way to detect




Friday, April 6, 12
™ the bad parts ™
                                            browser issues



                      Firefox doesn’t connect to ws:// from a secure
                      https page.
                      can be detected <3!




Friday, April 6, 12
™ the bad parts ™
                                 connection blockage




                                       firewall
                      browser         anti-virus       server
                                       plugins
Friday, April 6, 12
™ the bad parts ™
                                        connection blockage


                       3% of all requests on port 4000
                       were blocked
                       out of the unique 100k connections tested




                      enterprise proxies usually block
                      everything except port 80,443,843
                      and virus scanners usually target port 80 for scanning & blocking



Friday, April 6, 12
Friday, April 6, 12
™ the bad parts ™
                                 connection blockage


                      to minimize the impact use SSL by
                      default

                      if this is not possible fallback from
                      different ports

                          4000          843          80

Friday, April 6, 12
go hybrid


Friday, April 6, 12
socket.io


Friday, April 6, 12
socket.io
            Full hybrid real time server
            blurring the differences between transport methods


            100% JavaScript
            powered by Node.js <3, npm install socket.io and your done, but it’s also ported
            to different languages


            Open Souce MIT license
            github.com/LearnBoost/socket.io(-client)




Friday, April 6, 12
socket.io

                        Comes with tons of features
                      encoding, multiplexing, heartbeats, authentication, scaling




Friday, April 6, 12
socket.io
                      high performance, lower is better


                                     Google Chrome 16
                                            x




                                                          ws

Friday, April 6, 12
socket.io
                      autobahn testsuite




                                           ws

Friday, April 6, 12
socket.io
                                how does it work




                      visitor                      socket.io


Friday, April 6, 12
socket.io
                                how does it work




                                 handshake request
                      visitor                        socket.io


Friday, April 6, 12
socket.io
                                      how does it work


                                accepted transports, connection id and
                                          config is returned




                                        handshake accepted
                      visitor                                        socket.io


Friday, April 6, 12
socket.io
                                how does it work



                                 feature detection is used to find a
                                 working transport layer




                      visitor                                  socket.io


Friday, April 6, 12
socket.io
                        supported transport methods

                      Web Socket   HIXIE 75/76 HIBI




Friday, April 6, 12
socket.io
                         supported transport methods

                      Web Socket     HIXIE 75/76 HIBI




                      Flash Socket   FLASH 10+




Friday, April 6, 12
socket.io
                         supported transport methods

                      Web Socket      HIXIE 75/76 HIBI




                      Flash Socket    FLASH 10+




                      HTML File   IE 5.5+




Friday, April 6, 12
socket.io
                         supported transport methods

                      Web Socket      HIXIE 75/76 HIBI




                      Flash Socket    FLASH 10+




                      HTML File   IE 5.5+




                      XHR Polling     IE6,FF,OPERA,WEBKIT




Friday, April 6, 12
socket.io
                         supported transport methods

                      Web Socket      HIXIE 75/76 HIBI




                      Flash Socket    FLASH 10+




                      HTML File   IE 5.5+




                      XHR Polling     IE6,FF,OPERA,WEBKIT




                      JSONP Polling         EVERYONE



Friday, April 6, 12
socket.io
                                 how does it work




                                  real time connection is
                                established with the server
                      visitor       using the transport       socket.io


Friday, April 6, 12
socket.io
                                 how does it work


                                 heartbeats are send to
                                ensure proper connection




                      visitor                              socket.io


Friday, April 6, 12
live
                      CODING




Friday, April 6, 12
socket.io next
                            a.k.a


              engine.io & websocket.io

Friday, April 6, 12
engine.io & websocket.io
            Transport upgrading instead of downgrading
            faster connection times, less prone to errors




Friday, April 6, 12
engine.io & websocket.io
            Transport upgrading instead of downgrading
            faster connection times, less prone to errors


            Smaller because theres no sugar on top
            and transports can be lazy loaded




Friday, April 6, 12
engine.io & websocket.io
            Transport upgrading instead of downgrading
            faster connection times, less prone to errors


            Smaller because theres no sugar on top
            and transports can be lazy loaded


            WebSocket only interface
            for those of your who think websockets are good enough, but you really shouldn’t




Friday, April 6, 12
Q&Awill be answered in real time




                      talk nerdy to me
Friday, April 6, 12
github    @3rd-eden
                                   &
                                @3rdeden
                      twitter




Friday, April 6, 12

Contenu connexe

En vedette

Going real time with Socket.io
Going real time with Socket.ioGoing real time with Socket.io
Going real time with Socket.ioArnout Kazemier
 
Real-time Web Application with Socket.IO, Node.js, and Redis
Real-time Web Application with Socket.IO, Node.js, and RedisReal-time Web Application with Socket.IO, Node.js, and Redis
Real-time Web Application with Socket.IO, Node.js, and RedisYork Tsai
 
Building notification system in NodeJS + Redis
Building notification system in NodeJS + RedisBuilding notification system in NodeJS + Redis
Building notification system in NodeJS + RedisLe Duc
 
Real Time Recommendations Using WebSockets and Redis - Ninad Divadkar, Inuit
Real Time Recommendations Using WebSockets and Redis - Ninad Divadkar, InuitReal Time Recommendations Using WebSockets and Redis - Ninad Divadkar, Inuit
Real Time Recommendations Using WebSockets and Redis - Ninad Divadkar, InuitRedis Labs
 
如何提昇技術力 - 參與技術社群之經驗分享
如何提昇技術力 - 參與技術社群之經驗分享如何提昇技術力 - 參與技術社群之經驗分享
如何提昇技術力 - 參與技術社群之經驗分享Caesar Chi
 
Transportation management system
Transportation management systemTransportation management system
Transportation management systemAbhay Korat
 

En vedette (7)

Going real time with Socket.io
Going real time with Socket.ioGoing real time with Socket.io
Going real time with Socket.io
 
Web Sockets
Web SocketsWeb Sockets
Web Sockets
 
Real-time Web Application with Socket.IO, Node.js, and Redis
Real-time Web Application with Socket.IO, Node.js, and RedisReal-time Web Application with Socket.IO, Node.js, and Redis
Real-time Web Application with Socket.IO, Node.js, and Redis
 
Building notification system in NodeJS + Redis
Building notification system in NodeJS + RedisBuilding notification system in NodeJS + Redis
Building notification system in NodeJS + Redis
 
Real Time Recommendations Using WebSockets and Redis - Ninad Divadkar, Inuit
Real Time Recommendations Using WebSockets and Redis - Ninad Divadkar, InuitReal Time Recommendations Using WebSockets and Redis - Ninad Divadkar, Inuit
Real Time Recommendations Using WebSockets and Redis - Ninad Divadkar, Inuit
 
如何提昇技術力 - 參與技術社群之經驗分享
如何提昇技術力 - 參與技術社群之經驗分享如何提昇技術力 - 參與技術社群之經驗分享
如何提昇技術力 - 參與技術社群之經驗分享
 
Transportation management system
Transportation management systemTransportation management system
Transportation management system
 

Similaire à Web5 pushing the web forward.apr

Lightning talks percona live mysql_2012
Lightning talks percona live mysql_2012Lightning talks percona live mysql_2012
Lightning talks percona live mysql_2012Giuseppe Maxia
 
Solr, Lucene and Hadoop @ Etsy
Solr, Lucene and Hadoop @ EtsySolr, Lucene and Hadoop @ Etsy
Solr, Lucene and Hadoop @ Etsylucenerevolution
 
Advances in BeEF - AthCon2012
Advances in BeEF - AthCon2012Advances in BeEF - AthCon2012
Advances in BeEF - AthCon2012Michele Orru
 
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009Boris Mann
 
Intravert atx meetup_condensed
Intravert atx meetup_condensedIntravert atx meetup_condensed
Intravert atx meetup_condensedzznate
 
CPANci: Continuous Integration for CPAN
CPANci: Continuous Integration for CPANCPANci: Continuous Integration for CPAN
CPANci: Continuous Integration for CPANMike Friedman
 
Introducing Riak and Ripple
Introducing Riak and RippleIntroducing Riak and Ripple
Introducing Riak and RippleSean Cribbs
 
Functional Web Apps with WebMachine Framework - Mikhail Bortnyk
Functional Web Apps with WebMachine Framework - Mikhail BortnykFunctional Web Apps with WebMachine Framework - Mikhail Bortnyk
Functional Web Apps with WebMachine Framework - Mikhail BortnykRuby Meditation
 
Functional Web Apps with WebMachine Framework
Functional Web Apps with WebMachine FrameworkFunctional Web Apps with WebMachine Framework
Functional Web Apps with WebMachine FrameworkAmoniac OÜ
 
Hadoop meets Cloud with Multi-Tenancy
Hadoop meets Cloud with Multi-TenancyHadoop meets Cloud with Multi-Tenancy
Hadoop meets Cloud with Multi-TenancyTreasure Data, Inc.
 

Similaire à Web5 pushing the web forward.apr (11)

Lightning talks percona live mysql_2012
Lightning talks percona live mysql_2012Lightning talks percona live mysql_2012
Lightning talks percona live mysql_2012
 
Solr, Lucene and Hadoop @ Etsy
Solr, Lucene and Hadoop @ EtsySolr, Lucene and Hadoop @ Etsy
Solr, Lucene and Hadoop @ Etsy
 
Advances in BeEF - AthCon2012
Advances in BeEF - AthCon2012Advances in BeEF - AthCon2012
Advances in BeEF - AthCon2012
 
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
 
Intravert atx meetup_condensed
Intravert atx meetup_condensedIntravert atx meetup_condensed
Intravert atx meetup_condensed
 
CPANci: Continuous Integration for CPAN
CPANci: Continuous Integration for CPANCPANci: Continuous Integration for CPAN
CPANci: Continuous Integration for CPAN
 
Introducing Riak and Ripple
Introducing Riak and RippleIntroducing Riak and Ripple
Introducing Riak and Ripple
 
Functional Web Apps with WebMachine Framework - Mikhail Bortnyk
Functional Web Apps with WebMachine Framework - Mikhail BortnykFunctional Web Apps with WebMachine Framework - Mikhail Bortnyk
Functional Web Apps with WebMachine Framework - Mikhail Bortnyk
 
Functional Web Apps with WebMachine Framework
Functional Web Apps with WebMachine FrameworkFunctional Web Apps with WebMachine Framework
Functional Web Apps with WebMachine Framework
 
Cors
CorsCors
Cors
 
Hadoop meets Cloud with Multi-Tenancy
Hadoop meets Cloud with Multi-TenancyHadoop meets Cloud with Multi-Tenancy
Hadoop meets Cloud with Multi-Tenancy
 

Dernier

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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 2024Victor Rentea
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
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...Jeffrey Haguewood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
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 educationjfdjdjcjdnsjd
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
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 WorkerThousandEyes
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
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 FMESafe Software
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 

Dernier (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
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...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
+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...
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Web5 pushing the web forward.apr

  • 1. pushing the web forward socket.io with Friday, April 6, 12
  • 2. who am i a socket.io core developer winner node knockout 2011 early node user since 0.1.3 founder observe.it Friday, April 6, 12
  • 3. github @3rd-eden & @3rdeden twitter Friday, April 6, 12
  • 4. i the state of real-time ii socket.io iii socket.io next Friday, April 6, 12
  • 5. the state of real-time Friday, April 6, 12
  • 7. the past comet, polling and other methods to abuse the web can i has data browser server Friday, April 6, 12
  • 8. the past comet, polling and other methods to abuse the web can i has data nope, dun has dataz ;( browser server Friday, April 6, 12
  • 9. the past comet, polling and other methods to abuse the web can i has data nope, dun has dataz ;( can i has data pretty plx browser server Friday, April 6, 12
  • 10. the past comet, polling and other methods to abuse the web can i has data nope, dun has dataz ;( can i has data pretty plx yes, i has ur dataz browser server Friday, April 6, 12
  • 11. the past comet, polling and other methods to abuse the web can i has data nope, dun has dataz ;( can i has data pretty plx yes, i has ur dataz ohi can i has dataz browser server Friday, April 6, 12
  • 12. the past used transport methods XHR & JSONP polling can be used cross domain, JSONP connections usually use an iframe to post messages Friday, April 6, 12
  • 13. the past used transport methods iFrame / HTMLFile streaming HTMLFile is used to hide the loading indicators as the connection with server is never closed so it can stream in new messages Friday, April 6, 12
  • 14. the past used transport methods Plugins, Java, Flash, Silverlight everybody has this awesome bloatware installed Friday, April 6, 12
  • 15. the past used transport methods EventSource and multipart XHR EventSource was actually implemented in opera 9 and combined with XHR multi-part from firefox we got two good streaming read only solutions Friday, April 6, 12
  • 16. the past used transport methods window.name used to create cross-domain browser transport, first used in Dojo Friday, April 6, 12
  • 17. HTML5 the future Friday, April 6, 12
  • 18. websockets the good parts ™ Friday, April 6, 12
  • 19. ™ the good parts ™ Bidirectional Friday, April 6, 12
  • 20. ™ the good parts ™ Bidirectional Persistent Friday, April 6, 12
  • 21. ™ the good parts ™ Bidirectional Persistent Light weight Friday, April 6, 12
  • 22. ™ the good parts ™ Bidirectional Persistent Light weight Blazing fast Friday, April 6, 12
  • 23. websockets the bad parts ™ Friday, April 6, 12
  • 24. ™ the bad parts ™ No full browser coverage Friday, April 6, 12
  • 25. ™ the bad parts ™ No full browser coverage Browser issues Friday, April 6, 12
  • 26. ™ the bad parts ™ No full browser coverage Browser issues Connection blockage Friday, April 6, 12
  • 27. ™ the bad parts ™ No full browser coverage Browser issues Connection blockage Bad server HTTP proxy support Friday, April 6, 12
  • 28. ™ the bad parts ™ no full browser support yet 16+ 8+ 11.6+ 5+ 10+ RFC RFC HIXIE HIXIE RFC Friday, April 6, 12
  • 29. ™ the bad parts ™ browser issues Friday, April 6, 12
  • 30. ™ the bad parts ™ browser issues Usage or detecting a HTTP proxy (AutoProxyDiscovery) crashes < Safari 5.1.4 and Mobile Webkit your fucked or use user agent sniffing Friday, April 6, 12
  • 31. ™ the bad parts ™ browser issues Writing to a closed WebSocket connection can crash the browser & tabs check for connection state with a setTimeout Friday, April 6, 12
  • 32. ™ the bad parts ™ browser issues 3G connections can crash WebSocket fucked, again, disable websockets on portable devices, until netinfo API is supported Friday, April 6, 12
  • 33. ™ the bad parts ™ browser issues Pressing ESC in Firefox will drop the established connection. Even after the page has fully loaded. capture the event early and try to cancel it Friday, April 6, 12
  • 34. ™ the bad parts ™ browser issues Sending invalid UTF-8 drops the connection escape & encodeURI your data Friday, April 6, 12
  • 35. ™ the bad parts ™ browser issues TCP socket leaks in Chrome if you get disconnected from the internet you’re fucked, no way to detect Friday, April 6, 12
  • 36. ™ the bad parts ™ browser issues Firefox doesn’t connect to ws:// from a secure https page. can be detected <3! Friday, April 6, 12
  • 37. ™ the bad parts ™ connection blockage firewall browser anti-virus server plugins Friday, April 6, 12
  • 38. ™ the bad parts ™ connection blockage 3% of all requests on port 4000 were blocked out of the unique 100k connections tested enterprise proxies usually block everything except port 80,443,843 and virus scanners usually target port 80 for scanning & blocking Friday, April 6, 12
  • 40. ™ the bad parts ™ connection blockage to minimize the impact use SSL by default if this is not possible fallback from different ports 4000 843 80 Friday, April 6, 12
  • 43. socket.io Full hybrid real time server blurring the differences between transport methods 100% JavaScript powered by Node.js <3, npm install socket.io and your done, but it’s also ported to different languages Open Souce MIT license github.com/LearnBoost/socket.io(-client) Friday, April 6, 12
  • 44. socket.io Comes with tons of features encoding, multiplexing, heartbeats, authentication, scaling Friday, April 6, 12
  • 45. socket.io high performance, lower is better Google Chrome 16 x ws Friday, April 6, 12
  • 46. socket.io autobahn testsuite ws Friday, April 6, 12
  • 47. socket.io how does it work visitor socket.io Friday, April 6, 12
  • 48. socket.io how does it work handshake request visitor socket.io Friday, April 6, 12
  • 49. socket.io how does it work accepted transports, connection id and config is returned handshake accepted visitor socket.io Friday, April 6, 12
  • 50. socket.io how does it work feature detection is used to find a working transport layer visitor socket.io Friday, April 6, 12
  • 51. socket.io supported transport methods Web Socket HIXIE 75/76 HIBI Friday, April 6, 12
  • 52. socket.io supported transport methods Web Socket HIXIE 75/76 HIBI Flash Socket FLASH 10+ Friday, April 6, 12
  • 53. socket.io supported transport methods Web Socket HIXIE 75/76 HIBI Flash Socket FLASH 10+ HTML File IE 5.5+ Friday, April 6, 12
  • 54. socket.io supported transport methods Web Socket HIXIE 75/76 HIBI Flash Socket FLASH 10+ HTML File IE 5.5+ XHR Polling IE6,FF,OPERA,WEBKIT Friday, April 6, 12
  • 55. socket.io supported transport methods Web Socket HIXIE 75/76 HIBI Flash Socket FLASH 10+ HTML File IE 5.5+ XHR Polling IE6,FF,OPERA,WEBKIT JSONP Polling EVERYONE Friday, April 6, 12
  • 56. socket.io how does it work real time connection is established with the server visitor using the transport socket.io Friday, April 6, 12
  • 57. socket.io how does it work heartbeats are send to ensure proper connection visitor socket.io Friday, April 6, 12
  • 58. live CODING Friday, April 6, 12
  • 59. socket.io next a.k.a engine.io & websocket.io Friday, April 6, 12
  • 60. engine.io & websocket.io Transport upgrading instead of downgrading faster connection times, less prone to errors Friday, April 6, 12
  • 61. engine.io & websocket.io Transport upgrading instead of downgrading faster connection times, less prone to errors Smaller because theres no sugar on top and transports can be lazy loaded Friday, April 6, 12
  • 62. engine.io & websocket.io Transport upgrading instead of downgrading faster connection times, less prone to errors Smaller because theres no sugar on top and transports can be lazy loaded WebSocket only interface for those of your who think websockets are good enough, but you really shouldn’t Friday, April 6, 12
  • 63. Q&Awill be answered in real time talk nerdy to me Friday, April 6, 12
  • 64. github @3rd-eden & @3rdeden twitter Friday, April 6, 12