6

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 ?

Vikram Ranabhatt
  • 7,268
  • 15
  • 70
  • 133

1 Answers1

14

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.

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
  • 1
    is this still valid? the link is broken – David Chase Aug 07 '14 at 12:51
  • 3
    @DavidChase: According to the front page of their website: *"It works on every platform, browser or device, focusing equally on reliability and speed."* Big claim! – T.J. Crowder Aug 07 '14 at 13:37
  • yeah i see that, im looking into either socket.io or https://github.com/faye/faye or https://github.com/topcloud/socketcluster seems that both socket.io and faye support legacy browser my interest being only as far back as ie9 – David Chase Aug 07 '14 at 13:57
  • @DavidChase: Oh, I'm sure IE9 is very well supported by socket.io. I don't know anything about the other ones. (You don't need IE8 support? [21% global market share](http://marketshare.hitslink.com/browser-market-share.aspx?qprid=2&qpcustomd=0) presently. IE8 is going to be with us a while longer, thanks to XP [even though XP is supposedly meant to be dead]...) – T.J. Crowder Aug 07 '14 at 14:12
  • 1
    yeah fortunately I am at company doing a re-platforming that does not care about IE8 :) and most of our traffic is moving towards mobile anyways – David Chase Aug 07 '14 at 14:37
  • thanks for the list of transports! Can't find it anywhere in docs. If you have errors with some browsers, try different transport settings, like in this question: http://stackoverflow.com/questions/7016144/define-transport-types-on-the-client-side – Lukas Liesis Jun 18 '15 at 18:55
  • 1
    @LukasLiesis: Yeah, things seem to have changed. I updated a bit. – T.J. Crowder Jun 18 '15 at 21:06