Take the 2-minute tour ×

I so often see titles like "Node.JS + socket.io tutorials." Even in the Node.js Beginner book I've purchased, it tells me to download socket.io so I'm getting really confused.

What's the difference between them? Why can't I code my applications just with Node.JS "OR" Socket.io? If I can code, why do people socket.io plus node.js in titles?

I'm really confused so any kind of replies would be appreciated.

share|improve this question

4 Answers 4

up vote 15 down vote accepted

Socket.io is a framework on node.js for realtime applications. So, both is required if you want to use socket.io. You can code your own to do the same thing but socket.io is cross-browser and by using it can help you save time.

share|improve this answer
So node.js is like Apache, whereas socket.io is PHP? –  Icarus Cocksson Dec 20 '12 at 3:10
@IcarusCocksson: Well... node.js is like Apache and PHP, whereas socket.io is like <insert PHP library>. –  U2744 SNOWFLAKE Dec 20 '12 at 3:13
Hmm, I think I understood. I'll use node.js, but socket.io will help me dealing with websockets and such. Right? –  Icarus Cocksson Dec 20 '12 at 3:15
@icarus you're right. –  Licson Dec 20 '12 at 3:31
Socket.IO is also the client lib. There are a few different backends, so a Socket.io based app need not have a Node.js component. –  Alex Wright Dec 23 '12 at 0:18

node.js is a platform.

socket.io is just a framework for dealing with websockets if your are building an app on top of node.js.

socket.io needs node.js but node.js does not need socket.io

EDIT: Ryan Dahl's (node.js's creator) intro video is really instructive and helps with this kind of confusion: http://www.youtube.com/watch?v=jo_B4LTHi3I

share|improve this answer

socket.io is a library, addition to actual platform which is node.js. It is like a software to computer. You can't use software without computer.

Node.js - is platform, that takes care about language - JavaScript visualization using V8 (JavaScript Engine that interpret JS script to understandable form to the computer). And lots of other components of platform.

While socket.io is just using features of platform, implements some cool own features that are addition to node. It is just a library, addition that you use along with the core.

In real world its like hoover - is a node.js, and nozzle is socket.io. Of course it is rough example, and things are much more complicated. But as you can see, nozzle is pointless without core.

Node.js makes your JavaScript running using own features. While socket.io is something you use or not - by your choice.

share|improve this answer

I am also learning nitt- griities of nodejs , socket.io , express etc . What I have understood so far is that Nodejs is the big backbone of hosting the entire project ( could be both on client and server's end ) with the node command like > node servercode.js etc . It can open ports for websockets server , Http server even https server .

However socketio provides the communication link between the client and server side in an asynchronous event driven manner ( think ajax ) .

Hope it helped

share|improve this answer

Your Answer


