discord-player-play-dl/docs/youtube/proxy.md

19 lines
601 B
Markdown
Raw Normal View History

2021-04-21 13:30:40 +05:00
# Using Proxy to avoid 429
```js
const { Player } = require("discord-player");
const HttpsProxyAgent = require("https-proxy-agent");
// Remove "user:pass@" if you don't need to authenticate to your proxy.
const proxy = "http://user:pass@111.111.111.111:8080";
const agent = HttpsProxyAgent(proxy);
const player = new Player(client, {
2021-06-20 19:22:09 +05:00
ytdlOptions: {
2021-04-21 13:30:40 +05:00
requestOptions: { agent }
}
});
2021-11-28 12:57:25 +05:00
```
> You may also create a simple proxy server and forward requests through it.
> See **[https://github.com/http-party/node-http-proxy](https://github.com/http-party/node-http-proxy)** for more info.