Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web Socket support in Node.js/Socket.io for older browser

I have created a Web Socket server using c++.As we know that HTML 5 support Web Socket and we have standard Web Socket Java Script Api to communicate with web socket server.I am able to connect to web Socket server using Web Socket Api. Since Web Socket Api is supported in Only new browser.

 IE          version 10    
 Chrome      version 16   
 Firefox     version 6   
 Safari      version 6.0   
 Opera       version 12.10

I need to provide support for following browser version as well.
Web Socket Api Supported browser

 IE          version 7
 Chrome      version 14
 Firefox     version 4   
 Safari      version 5.1 

I heard about node.js and socket.io. both are supported on

Web Socket Api not Supported Browser
Internet Explorer 5.5+ Safari 3+ Google Chrome 4+ Firefox 3+ Opera 10.61+

I wanted to write java script client to connect to Web Sokcet server using Node.js/Socket.io

Does Node.js/Socket.io allow me to connect in older browser ?

like image 856
Vikram Ranabhatt Avatar asked Nov 11 '13 10:11

Vikram Ranabhatt


1 Answers

You can support those browsers with Socket.io, yes, but not specifically with web sockets (as many of those browsers versions don't have web sockets).

As of November 2013, Socket.io's list of supported browsers was:

Desktop:

  • Internet Explorer 5.5+
  • Safari 3+
  • Google Chrome 4+
  • Firefox 3+
  • Opera 10.61+

Mobile:

  • iPhone Safari
  • iPad Safari
  • Android WebKit
  • WebOs WebKit

They achieve this level of support by using a variety of transports, depending on what the browser is capable of (again, from November 2013):

  • WebSocket
  • Adobe® Flash® Socket
  • AJAX long polling
  • AJAX multipart streaming
  • Forever Iframe
  • JSONP Polling

Since then, Socket.io has been split up into (at least) Socket.io and Engine.io where the latter provides the transports. And it seems like Engine.io's list of transports has dramatically reduced:

  • polling: XHR / JSONP polling transport
  • websocket: WebSocket transport

It seems to suggest there's still a way of doing Flash sockets as well.

Presumably this reflects the fact that websockets are almost universally supported in modern browsers.

like image 155
T.J. Crowder Avatar answered Nov 08 '22 09:11

T.J. Crowder