monty-python icon indicating copy to clipboard operation
monty-python copied to clipboard

fix: apply proxy to (almost) all requests

Open shiftinv opened this issue 1 year ago • 0 comments

Right now, the BOT_PROXY_URL env variable only applies to bot.http_session. This PR expands this to more requests:

  • All requests to the Discord API by the underlying disnake client (except interaction responses due to https://github.com/DisnakeDev/disnake/issues/261)
  • GraphQL requests to GitHub

The GraphQL one was a bit annoying, since graphql-python doesn't have a proxy parameter itself. It does, however, support passing arbitrary kwargs to the created aiohttp.ClientSession, which we can use to set a proxy by providing a custom request_class=.

shiftinv avatar Sep 25 '24 12:09 shiftinv