Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/401.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何将经过身份验证的代理与undici一起使用_Javascript_Node.js_Proxy_Request - Fatal编程技术网

Javascript 如何将经过身份验证的代理与undici一起使用

Javascript 如何将经过身份验证的代理与undici一起使用,javascript,node.js,proxy,request,Javascript,Node.js,Proxy,Request,你好,所以我尝试使用undici和代理,但它不工作,我厌倦了这个 const client = new Client({ url: 'www.google.com', proxy: 'http://user:pass@host:port' }) 还有这个 const { HttpsProxyAgent } = require("https-proxy-agent"); const proxy = new HttpsProxyAgent("http://us

你好,所以我尝试使用undici和代理,但它不工作,我厌倦了这个

const client = new Client({
  url: 'www.google.com',
  proxy: 'http://user:pass@host:port'
})
还有这个

const { HttpsProxyAgent } = require("https-proxy-agent");
const proxy = new HttpsProxyAgent("http://user:pass@host:port");
time = new Date()
client.request({
  path: '/',
  method: 'GET',
  httpsAgent: proxy 
},
但似乎什么都不管用