I’m trying to get socket.io set up on Heroku, so I have this code on my main script:
var io = require('socket.io');
io.configure(function () {
io.set("transports", ["xhr-polling"]);
io.set("polling duration", 10);
});
When I try to run, I get the following error:
TypeError: Object #(Object) has no method 'configure'
I have Socket.io in the dependencies, and I’ve tried adding a .listen() but then I get a “has no method ‘listeners’ error.
Your help is much appreciated.
Try this:
You trying to configure wrong object. Method listen creates Socket.IO instance.