Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 904 Bytes

README.md

File metadata and controls

17 lines (12 loc) · 904 Bytes

What is this?

restproxy is a HTTP reverse proxy for the Discord API that includes a ratelimiter.

Where is this used?

We use this utility on the Artemis bot in production.

How does this work?

restproxy is based on an AMQP RPC architecture. A consumer listens on queue for API requests, performs them and then responds through the publisher with the response from the Discord API.

A request object is created, using the URL, the request type, the headers and the content fields from the struct.

The request is then sent to a queue, which the ratelimiter reads from as instructed to by the Discord API, to not trip the ratelimit and get a 429.

Finally, the response is then proxied back to the client. This means that HTTP requests may well take several seconds, and therefore clients using this utility must making all requests asynchronously.