Overview
Discord Player supports custom HTTP request options for searches and streaming, allowing you to implement IP rotation, use proxies, or customize request headers. This is particularly useful for bypassing rate limits or implementing advanced networking configurations.Request Options
TherequestOptions parameter accepts Node.js http.RequestOptions and is available in search operations:
IP Rotation
Use thelocalAddress option to rotate between multiple IP addresses:
Proxy Configuration
Configure HTTP/HTTPS proxies using an agent:SOCKS Proxy
Use SOCKS proxies for additional privacy:Custom Headers
Add custom headers to requests:Advanced IP Rotation System
Implement a sophisticated IP rotation system with health checks:Proxy Pool
Rotate between multiple proxies:Request Options in Streaming
Request options are automatically passed to the streaming layer:FFmpeg Integration
Request options are passed to FFmpeg when streaming:-user_agent and -headers flags.
Rate Limit Mitigation
Combine IP rotation with retry logic:Environment-Based Configuration
Configure proxies/IPs from environment variables:Use Cases
Rate Limit Bypass
Distribute requests across multiple IPs to avoid rate limits
Geographic Restrictions
Use proxies in different regions to access geo-restricted content
Load Distribution
Balance network load across multiple network interfaces
Privacy
Route requests through proxies for enhanced privacy
Best Practices
Monitor IP health
Monitor IP health
Implement health checks to detect and exclude failed IPs from rotation.
Use connection pooling
Use connection pooling
Reuse agent instances instead of creating new ones for each request.
Implement exponential backoff
Implement exponential backoff
When retrying failed requests, use exponential backoff to avoid overwhelming services.
Respect rate limits
Respect rate limits
IP rotation is not a license to abuse APIs. Always respect service rate limits.
Secure proxy credentials
Secure proxy credentials
Store proxy credentials in environment variables, not in code.
Related
Search API
Learn about search options
Extractors
Understanding extractor system