Reputation: 31
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
Upvotes: 1
Views: 2183
Reputation: 8588
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!
Upvotes: 1