Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you configure nowjs?

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 
  });  
  socketServer.set('log level', 1);
});

Thanks!!

like image 599
Evan Avatar asked Aug 11 '11 20:08

Evan


1 Answers

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}});
like image 124
Eric Zhang Avatar answered Sep 20 '22 23:09

Eric Zhang