Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have seen the introductory course on YouTube (1 hour), and I wanted to try and "clone" the chat example on my pc.
I have installed node.js for windows (0.8.2), and I have opened the command prompt in the start menu folder called: "Node.js command prompt",
Then I created a file named: "chat.js".


var net = require('net');
var sockets = [];

var server = net.createServer(function (socket){
    socket.write("Hello and Welcome!\n");
    socket.on('data', function(data){
        for(var i  = 0;i<sockets.length;i++){
            if(socket != sockets[i]){
    socket.on('end', function(){
        sockets.splice (sockets.indexOf(socket),1);
        socket.end("Ended Chat");


When I type node chat.js I get the following: enter image description here

And it stays that way.
When I try to connect via telnet I get the following:
enter image description here

What should I do in order to start the server correctly and start communicating with it?

share|improve this question
up vote 1 down vote accepted

The telnet command is wrong. Should be telnet 8000. Space instead of a : between hostname and port. You can see this from the error message that it's trying to connect via port 23 which is the default for the Telnet program.

share|improve this answer
Thanks, it worked. – funerr Jul 19 '12 at 15:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.