在 puppeteer + Charles 中从本地主机更改为代理时获得 302

getting 302 when changing from local host to a proxy in puppeteer + Charles

所以我正在使用 Charles 的外部代理设置并使用 puppeteer,问题是当我将代理服务器作为本地主机放在 puppeteer 中时

"--proxy-server=127.0.0.1:8888"

一切正常,但当我关闭 Charles 并使用另一个经过身份验证的代理时,服务器 return 302 雕像并重定向我, 我检查了本地主机的 headers,当我更改我的代理时,两者都是相同的

我将其用作 header

  await page.setExtraHTTPHeaders({
     "Host": "www.supremenewyork.com",
  "Connection": "keep-alive",
  "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36",
  'Accept':"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
  "Sec-Fetch-Site": "same-origin",
  "Sec-Fetch-Mode": "cors",
  "Sec-Fetch-Dest": "empty",
  "Accept": "application/json",
  "Sec-Fetch-User": "1",
  "Sec-Fetch-Dest": "document",
  "referer" :`https://www.supremenewyork.com/mobile/`,
  "Accept-Encoding": " gzip, deflate, br",
  "Accept-Language": " en-GB,en-US;q=0.9,en;q=0.8",
  "Cookie": `${set_cookie}`,
  "dnt": "1",
  "sec-fetch-site" : "same-origin"
},
)

由于某种原因,问题是由于代理身份验证,我使用了代理链并且成功了 XD