Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js web application browser compatibility

I heard node.js is an ideal framework for building real time web application (chatting, live feeds etc...), then i guess it involve lot of socket io connection between nodejs and client browser.

in client side do i have to use websocket(html5) in order to communicate with node.js, if that is the case, then most of the older browser won't support HTML5-Websocket.

Question : are real time web applications built using node.js will work only with HTML5 compatible browsers.?

like image 939
Sark Avatar asked Feb 25 '14 13:02

Sark


People also ask

Does node JS run on all browsers?

js is a server-side, open-source, JavaScript runtime environment. Node uses Google's V8 engine---libUV---to deliver cross-platform compatibility and a core library. Notably, Node. js does not expose a global window object, since it does not run within a browser.

How do I know if my website is compatible with all browsers?

BrowserStack Live is a mobile application and browser testing tool. You can test your website on 2000+ browsers, thereby making it one of the comprehensive browser compatibility tests. You can test your website on Android and iOS real devices using their cloud platform.

Does node js only work on Chrome?

Node. js is JavaScript on the server. For example, you can start a Node. js server on http://localhost:8000/, and you can access it with Chrome or Firefox.

CAN node JS run outside a browser?

The V8 engine is what powers both chrome and nodejs. When used with nodejs, it provides a runtime environment for javascript that allows JS code to be run "outside the browser".


2 Answers

Many nodejs chat applications use socket.io.

socket.io has a fallback (involving pulling or Flash) for browsers not having websockets :

Socket.IO aims to make realtime apps possible in every browser and mobile device, blurring the differences between the different transport mechanisms. It's care-free realtime 100% in JavaScript.

The point of using socket.io is that you don't really care, you just use it and most browsers will use websockets while some won't (but they still will work as well as possible).

like image 194
Denys Séguret Avatar answered Oct 21 '22 04:10

Denys Séguret


I heard node.js is an ideal framework for building real time web application (chatting, live >feeds etc...), then i guess it involve lot of socket io connection between nodejs and client >browser.

Yes, what you have heard is correct. It does involve a socket.io connection between client browser and the server

Read more about socket.io here

in client side do i have to use websocket(html5) in order to communicate with node.js, if >that is the case, then most of the older browser won't support HTML5-Websocket.

socket.io package of Node JS creates a WebSocket connection internally, if the client is using HTML5 enabled browser. In other browsers, it will fall back gracefully to different transport mechanisms.

Question : are real time web applications built using node.js will work only with HTML5 >compatible browsers.?

Above comments must have made clear, it will work in all supported browsers, if you use socket.io :) See Browser support for socket.io

like image 42
Manu Avatar answered Oct 21 '22 04:10

Manu