lib/server.js
function Server(opts){
  // Shorthand, no "new" required.
  if (!(this instanceof Server))
    return new Server(...arguments);

  if (typeof opts !== 'object')
    opts = {};

  this.clients = opts.dummies || [];

  this.server = opts.server || new SocketServer(socket => {
    let client = new Client(socket);
    this.clients.push(client);
    this.emit('connection', client);

    client._socket.once('data', handshake.bind(client));
    client.on('handshake-done', () => {
      client._socket.on('data', message.bind(client));
    });
  });
}
function Server(opts){
  // Shorthand, no "new" required.
  if (!(this instanceof Server))
    return new Server(...arguments);

  if (typeof opts !== 'object')
    opts = {};

  this.clients = opts.dummies || [];

  this.server = opts.server || new SocketServer(socket => {
    let client = new Client(socket);
    this.clients.push(client);
    this.emit('connection', client);

    client._socket.once('data', handshake.bind(client));
    client.on('handshake-done', () => {
      client._socket.on('data', message.bind(client));
    });
  });
}
function Server ( opts ) { // Shorthand, no "new" required. if ( ! ( this instanceof Server ) ) return new Server ( ... arguments ) ; if ( typeof opts !== 'object' ) opts = { } ; this . clients = opts . dummies || [ ] ; this . server = opts . server || new SocketServer ( socket => { let client = new Client ( socket ) ; this . clients . push ( client ) ; this . emit ( 'connection' , client ) ; client . _socket . once ( 'data' , handshake . bind ( client ) ) ; client . on ( 'handshake-done' , ( ) => { client . _socket . on ( 'data' , message . bind ( client ) ) ; } ) ; } ) ; }
The server object, Rela.
The server object Rela .