- socket.io@0.9.9
- socket.io-client@0.9.9
- 快递@3.0.0rc1
服务器代码:
//run with node-dev server.js
var remoteServer = io.of('/remote');
remoteServer.authorization(function(handshakeData, callback){
return callback('unknown clientType', false);
}
服务器日志:
You can visit your app with http://localhost:3000
info - handshake authorized l4FzYiWpHo2d8VeoB3Zo
warn - handshake error unknown clientType for /remote
客户端代码:
//run with node-dev client.js
var io = require('socket.io/node_modules/socket.io-client');
var client = io.connect('http://localhost:3000/remote');
client.on('connect_failed', function(reason){
console.log('connect_failed:', reason);
});
//will call this because it's Namespace authorization
client.on('error', function(reason){
console.log('error:', reason);
});
客户端日志:
//error reason miss.
E:\Workspace\TZ\SmartDoor\client>node-dev client.js
error: