如何在 undici 中使用经过身份验证的代理

时间:2021-03-03 15:10:49

标签: 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://user:pass@host:port");
time = new Date()
client.request({
  path: '/',
  method: 'GET',
  httpsAgent: proxy 
},

但似乎没有任何效果

0 个答案:

没有答案
相关问题