开发者

How can you configure nowjs?

开发者 https://www.devze.com 2023-03-27 18:08 出处:网络
With nowjs how do I configure the lower level socket.io\'s logging level and it\'s per connection (global) authentication level?

With nowjs how do I configure the lower level socket.io's logging level and it's per connection (global) authentication level?

For example if I were just using socket.io I would use the following code:

socketServer.configure(function (){  
  socketServer.set('authorization', function (handshakeData, callback) { 
    callback(null, true); // error first callback style 
  });  
  socketS开发者_JAVA技巧erver.set('log level', 1);
});

Thanks!!


You can pass in socket.io options in the nowjs.initialize() call under the socketio key.

Example:

 nowjs.initialize(httpServer, {socketio: {'log level': 1, 'authorization': myfunc}});
0

精彩评论

暂无评论...
验证码 换一张
取 消