Sign inSign up

twilightrs/http-proxy

By twilightrs

•Updated over 3 years ago

Ratelimited Discord HTTP API proxy. See https://github.com/twilight-rs/http-proxy

Image
0

100K+

twilightrs/http-proxy repository overview

⁠twilight-http-proxy

http-proxy is a ratelimited HTTP proxy in front of the Discord API, making use of twilight⁠.

⁠Using it

HTTP clients often support proxies, such as Ruby's Net::HTTP⁠. Read into your HTTP client to see how to use it.

twilight_http natively supports using twilight_http_proxy, so you can use it like this:

use twilight_http::client::{
    Proxy,
    Client,
};
use std::error::Error;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
    let mut config = Client::builder();
    config
        .proxy(Proxy::all("http://localhost:3000")?)
        .proxy_http(true)
        .skip_ratelimiter(true);
    let client = config.build()?;
}

This will use the running proxy, skip the ratelimiter (since the proxy does ratelimiting itself), and will request over HTTP. If your proxy is configured to listen via HTTPS, then don't use HTTP.

⁠Running via Docker

Build the dockerfile and then run it:

$ docker run -itd -e DISCORD_TOKEN="my token" -p 3000:80 twilightrs/http-proxy:v8

If your clients are using the Discord API v6, use the v6 instead of the v8 tag.

This will set the discord token to "my token" and map the bound port to port 3000 on the host machine.

Tag summary

Content type

Image

Digest

sha256:8a128a411…

Size

1.9 MB

Last updated

over 3 years ago

docker pull twilightrs/http-proxy