我将风帆从v0.10迁移到v0.11,我也按照迁移指南进行了操作,并执行了以下操作,
sails生成sails.io.js --force。
beforeConnect和afterConnect功能。
我面临以下问题,
以下功能未执行,因此我无法将任何用户添加到房间
sails.sockets.join(req, roomName, function(err) {
/*code here*/
});
sockets.js中的beforeConnect函数根本没有调用。
beforeConnect: function(handshake, cb) {
// `true` allows the connection
console.log("connected");
return cb(null, true);
// (`false` would reject the connection)
},