Node.js Socket.io配置错误

Node.js Socket.io配置错误,node.js,socket.io,Node.js,Socket.io,我使用socket.io v.1.0.3 并尝试为生产配置 var io = require('socket.io')(server); io.configure('production', function() { log(" set config for production"); io.enable('browser client minification'); // se

我使用socket.io v.1.0.3

并尝试为生产配置

  var io = require('socket.io')(server);

            io.configure('production', function()
            {
                log(" set config for production");
                io.enable('browser client minification'); // send minified client
                io.enable('browser client etag'); // apply etag caching logic based on version number
                io.enable('browser client gzip'); // gzip the file
                io.set('log level', 1); // reduce logging
                io.set('transports', [ // enable all transports (optional if you want flashsocket)
                    'websocket', 'flashsocket', 'htmlfile', 'xhr-polling', 'jsonp-polling'
                ]);
            });
表示socket.io实例没有
configure

       io.configure('production', function()
               ^
TypeError: Object #<Server> has no method 'configure'
io.configure('production',function()
^
TypeError:对象#没有“配置”方法
怎么做


谢谢。

我在尝试在heroku上运行我的应用程序时遇到了这个问题,因为heroku不允许您使用websockets atm。在on事件中设置传输协议对我很有效

io.on('connection', function () {
  io.set("transports", ["xhr-polling"]);
  io.set("polling duration", 10);
});

谢谢。所以当前版本不支持这个,对吗?是的。当前版本不支持io.configureok谢谢提供信息,SJ