code: function Socket (opts) {
    if ('string' == typeof opts) {
      var uri = util.parseUri(opts);
      opts = arguments[1] || {};
      opts.host = uri.host;
      opts.secure = uri.protocol == 'https' || uri.protocol == 'wss';
      opts.port = uri.port;
    }
  
    opts = opts || {};
    this.secure = null != opts.secure ? opts.secure : (global.location && 'https:' == location.protocol);
    this.host = opts.host || opts.hostname || (global.location ? location.hostname : 'localhost');
    this.port = opts.port || (global.location && location.port ? location.port : (this.secure ? 443 : 80));
    this.query = opts.query || {};
    this.query.uid = rnd();
    this.upgrade = false !== opts.upgrade;
    this.resource = opts.resource || 'default';
    this.path = (opts.path || '/engine.io').replace(/\/$/, '');
    this.path += '/' + this.resource + '/';
    this.forceJSONP = !!opts.forceJSONP;
    this.timestampParam = opts.timestampParam || 't';
    this.timestampRequests = !!opts.timestampRequests;
    this.flashPath = opts.flashPath || '';
    this.transports = opts.transports || ['polling', 'websocket', 'flashsocket'];
    this.readyState = '';
    this.writeBuffer = [];
    this.policyPort = opts.policyPort || 843;
    this.open();
  
    Socket.sockets.push(this);
    Socket.sockets.evs.emit('add', this);
  }
docs: Socket constructor.
  
  @param {Object} options
  @api public