Skip to content

Commit

Permalink
add proxy snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
SuspiciousLookingOwl committed Nov 8, 2024
1 parent 7b37e40 commit de9b687
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/docs/snippets-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,18 @@ const client = new Client({
},
});
```

### How to use Proxy

You can proxy your request using `http-proxy-agent` or `https-proxy-agent` by passing the agent instance to the client's `fetchOptions`

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

const proxyAgent = new HttpsProxyAgent(`https://${user}:${pass}@${host}:${port}`);
const client = new Client({
fetchOptions: {
agent: proxyAgent,
},
});
```

0 comments on commit de9b687

Please sign in to comment.