mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
chore(proxy-container): update README for proper request forwarding (#8692)
* chore(proxy-container): update README for proper request forwarding * chore: remove unused import Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -29,16 +29,25 @@ Use it:
|
||||
|
||||
```ts
|
||||
import { Client } from 'discord.js';
|
||||
import { ProxyAgent } from 'undici';
|
||||
|
||||
const client = new Client({
|
||||
// other options,
|
||||
rest: {
|
||||
agent: new ProxyAgent('https://localhost:8080'),
|
||||
api: 'http://localhost:8080/api',
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Or with just `@discordjs/rest`:
|
||||
|
||||
```ts
|
||||
import { REST } from '@discordjs/rest';
|
||||
|
||||
const rest = new REST({
|
||||
api: 'http://localhost:8080/api',
|
||||
});
|
||||
```
|
||||
|
||||
## Links
|
||||
|
||||
- [Website](https://discord.js.org/) ([source](https://github.com/discordjs/website))
|
||||
|
||||
Reference in New Issue
Block a user