code: function normalizeServer(server) {
    // normalize hostname
    if (!reProtocol.test(server)) {
      server = 'http://' + server;
    }
    server = url.parse(server);
  
    return {
      protocol: server.protocol,
      hostname: server.hostname,
      auth: server.auth,
      pathname: server.pathname,
      port: parseInt(server.port, 10) || (server.protocol === 'https:' ? 443 : 80)
    };
  }
docs: Normalize server config