code: async function getData(uri, headers, proxy, retry) {
      // get file if uri is local
      if (uri.startsWith('file://')) {
          return {
              body: fs.readFileSync(url.fileURLToPath(p)),
          };
      }
      // base options
      headers = headers ? headers : {};
      let options = { headers, retry, encoding: null };
      // proxy
      if (proxy) {
          let host = proxy.host && proxy.host.match(':') ? proxy.host.split(':')[0] : ( proxy.host ? proxy.host : proxy.ip );
          let port = proxy.host && proxy.host.match(':') ? proxy.host.split(':')[1] : ( proxy.port ? proxy.port : null);
          let user = proxy.user || proxy['socks-login'];
          let pass = proxy.pass || proxy['socks-pass'];
          let auth = user && pass ? [user, pass].join(':') : null;
          if(host && port){
              options.agent = new ProxyAgent(url.format({
                  protocol: proxy.type,
                  slashes: true,
                  auth: auth,
                  hostname: host,
                  port: port,
              }));
          }
          else if(proxy.url){
              options.agent = new ProxyAgent(proxy.url);
          }
          options.timeout = 10000;
      }
      // do request
      return got(uri, options);
  }
docs: get url