phin icon indicating copy to clipboard operation
phin copied to clipboard

How do I use HTTP Proxies with this?

Open autistic-code opened this issue 2 years ago • 1 comments

autistic-code avatar Apr 20 '22 10:04 autistic-code

You can use the core HTTP options to set a custom agent. For example with the node package https-proxy-agent, you can define an agent including your custom proxy and refer it in the core HTTP options. Would look something like:

import { HttpsProxyAgent } from "https-proxy-agent";

const agent = new HttpsProxyAgent("https://your-proxy.com");

await p({
  url: "https://ethanent.me/name",
  core: {
    agent: agent,
  },
});

You can also use different proxy agent packages like proxy-agent.

Hope this helps future viewers.

MarcelBurgard avatar Nov 13 '23 10:11 MarcelBurgard