1

I want to integrate chat system by using PHP,node.js and socket.io. For this I have installed node.js in my local windows xp (node-v0.8.19-x86.msi) and when i click the node.js icon from start bar it showing just like command mode with ">". My question is what is next step, where should i write my code and how it connect with php and how to embed socket.io. or need any more step to complete the node.js installation process?

Please help me, i am first in node.js and socket.io

  • There are bunch of tutorials here http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js – Ahmed Feb 11 '13 at 16:44

1 Answers1

1

when i click the node.js icon from start bar it showing just like command mode with ">".

This is the node.js interpreter, you don't need to run it to run a node.js server.

First of all, create a folder where you want to write you server code, access this folder from the command line and use NPM to install Socket.IO

For example, lets say that you created the folder "MyNodeServer":

C:\MyNodeServer> npm install socket.io

This will create the node_modules folder inside your project folder and install the last version of socket.io into it.

Now you can start building your server, actually, if you want to connect from your client to your node/socket.io server you don't really need PHP in the middle, Socket.IO is serving its socket object file to your client. If you want to build a chat server, here is a tutorial I wrote few month ago, using node.js, socket.io and jquery in the client side:

http://udidu.blogspot.co.il/2012/11/chat-evolution-nodejs-and-socketio.html

And here you can download this chat project:

https://github.com/uditalias/chat-nodejs

Goodluck!

udidu
  • 8,269
  • 6
  • 48
  • 68
  • Thanks udidu, i did as you say that create one folder in C:/node (full permission with shared) and put the code ([link]C:\node> npm install socket.io) on command but i am getting access denied message. I just create folder only did't do nothing more. need to download any files or directory to node folder like socket.io ? – user1287923 Feb 12 '13 at 04:51
  • no, you don't need to download anything else, how did you installed nodejs on your windows machine? with the installer? – udidu Feb 12 '13 at 09:46