Socket.IO client library gives “welcome to” message

After some time I tried working with node.js and socket.IO again, but it didn't work as expected:

My setup

  1. Downloaded node.js from github and compiled it on my external webserver running on debian squeeze
  2. Created a directory for the node.js project
  3. Added locally with npm
  4. Created socketIO_server.js and just added this single line of code:

    var socketIO = require('').listen(8000);
  5. Started the socketIO_server.js and console log says "info - started"

  6. Opening http://domain.tld:8000 gives the message "welcome to"

The Problem

When I try to access the client library by http://domain.tld:8000/ it gives also the message "welcome to", but the console log shows "served static content /". I have no idea why this happens! I though the nginx server running parallel causes this problem but stopping the server didn't change anything.

Thanks for reading and help!



This is caused by a commit made to the EventEmitter lib of nodejs in a recent change. I've opened an issue on


This issue has been fixed as of 0.9.12



Can not serve when listening on port. (node 0.9.1-pre, 0.9.9)

Due to a recent commit to node, you can no longer splice out event listeners. This causes to display the welcome message when trying to access the client file as the original event listener does not get removed.

Example breakage:

var socketIO = require('').listen(8000);

This breaks due to the way node 0.9.1-pre changed the way you can access listeners for the EventEmitter lib.

nodejs commit that breaks

Make EventEmitter.listeners(event) return a copy of the listeners array instead of the array itself.

EventEmitter.prototype.listeners = function(type) {
   if (!isArray(this._events[type])) {
     this._events[type] = [this._events[type]];
-  return this._events[type];   
+  return this._events[type].slice(0);

Relative code:

// reset listeners
this.oldListeners = server.listeners('request').splice(0);


I ran into this problem a few days ago. Had to downgrade to v0.8.7 and it worked fine.


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.