cobalt icon indicating copy to clipboard operation
cobalt copied to clipboard

feat: support external proxies

Open teidesu opened this issue 8 months ago • 3 comments

added support for API_EXTERNAL_PROXY env variable that sets up a global undici dispatcher

definitely not the best way to do this (i really dislike relying on globals), but did it like this anyway because:

  • there isn't a single common wrapper over fetch() where i could provide a dispatcher
  • passing it manually everywhere is very tedious and error-prone (especially considering there aren't any types)
  • since api is supposed to run in a separate isolated process it probably won't affect what it isn't supposed to

one thing i worry about is the youtube handler which mentions reading dispatcher from streamInfo, but i couldn't find a place where it is being passed there 🧐

teidesu avatar Jun 25 '24 12:06 teidesu