Server constructor

Server([
  1. Map? opts
])

Implementation

Server([Map? opts]) {
  opts = opts ?? {};

  pingTimeout = opts['pingTimeout'] ?? 60000;
  pingInterval = opts['pingInterval'] ?? 25000;
  upgradeTimeout = opts['upgradeTimeout'] ?? 10000;
  maxHttpBufferSize = opts['maxHttpBufferSize'] ?? 10E7;
  allowUpgrades = false != opts['allowUpgrades'];
  allowRequest = opts['allowRequest'];
  cookie = opts['cookie'] == false
      ? false
      : opts['cookie'] ??
          'io'; //false != opts.cookie ? (opts.cookie || 'io') : false;
  cookiePath = opts['cookiePath'] == false
      ? false
      : opts['cookiePath'] ??
          '/'; //false != opts.cookiePath ? (opts.cookiePath || '/') : false;
  cookieHttpOnly = opts['cookieHttpOnly'] != false;

  if (!opts.containsKey('perMessageDeflate') ||
      opts['perMessageDeflate'] == true) {
    perMessageDeflate =
        opts['perMessageDeflate'] is Map ? opts['perMessageDeflate'] : {};
    if (!perMessageDeflate.containsKey('threshold')) {
      perMessageDeflate['threshold'] = 1024;
    }
  }
  httpCompression = opts['httpCompression'] ?? {};
  if (!httpCompression.containsKey('threshold')) {
    httpCompression['threshold'] = 1024;
  }

  initialPacket = opts['initialPacket'];
}