Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

9. Hacking HTML5 Connectivity > Hack 77. Inspect a Socket.IO Connection to Dete...

Hack 77. Inspect a Socket.IO Connection to Determine If It Is Native or Emulated

Chrome Developer tools can help with debugging network traffic. You can also disable web sockets to demonstrate the power of Socket.IO polyfills.

In this hack we’ll investigate the power of Socket.IO. Earlier, I explained that Socket.IO provides the ability to polyfill socket support for browsers that don’t have a socket implementation enabled yet. In previous hacks we used the Chrome Developer Tools to inspect WebSocket information.

One way to test the ability of Socket.IO to fall back to another mechanism is to go into the Chrome Dev Tools console and enter WebSocket = undefined (see Figure 9-42).

Turning off WebSocket support in Chrome
Figure 9-42. Turning off WebSocket support in Chrome

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint