mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 03:23:29 +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
|
```ts
|
||||||
import { Client } from 'discord.js';
|
import { Client } from 'discord.js';
|
||||||
import { ProxyAgent } from 'undici';
|
|
||||||
|
|
||||||
const client = new Client({
|
const client = new Client({
|
||||||
// other options,
|
// other options,
|
||||||
rest: {
|
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
|
## Links
|
||||||
|
|
||||||
- [Website](https://discord.js.org/) ([source](https://github.com/discordjs/website))
|
- [Website](https://discord.js.org/) ([source](https://github.com/discordjs/website))
|
||||||
|
|||||||
Reference in New Issue
Block a user