Using Node.js with Heroku to Create a Chat Server

node.js

I currently have a goal of creating a sort of chat website. I just finished trying with PHP and long polling, which hit a resource limit on my webhost's server. I was told that I should use Node.js and that it can be hosted with Heroku.

I honestly have very little understanding of what Node.js or Heroku are. From what I've been told and have read after looking this up is that you can install Node.js and run apps online with it. The tutorial here: http://www.jamesward.com/2011/06/21/getting-started-with-node-js-on-the-cloud/ goes over installing and executing a script on heroku with Node.js. I have NO experience with command line, and wouldn't be able to do anything but copy the exact commands in that tutorial. I also don't understand when he accesses the script with localhost if the app is supposed to be on Heroku.

Can anyone explain what Heroku is, and provide some resources on how to use it? How can I work my way up to knowing how to use it?

Best Answer

As for running a chat server, the chat example for socket.io can be up and running in about 5 minutes. Basically, copy-paste and you have real time chat.

You should know that Heroku does not support Websockets at this time. Socket.io will revert to xhr-polling or other techniques which really should work fine for chat, but it's not quite real time when using Heroku.

EDIT
Apparently I even did it to test at one point in the past.

Related Topic