[PR #588] [MERGED] feat: support external proxies #1211

Closed
opened 2025-11-09 10:08:11 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/imputnet/cobalt/pull/588
Author: @teidesu
Created: 6/25/2024
Status: Merged
Merged: 7/24/2024
Merged by: @wukko

Base: currentHead: ext-proxy


📝 Commits (2)

  • ea69fd8 feat: support external proxies
  • 3f8d5c2 fix: error when freebind is enabled

📊 Changes

3 files changed (+13 additions, -1 deletions)

View changed files

📝 docs/run-an-instance.md (+1 -0)
📝 src/core/api.js (+9 -0)
📝 src/modules/config.js (+3 -1)

📄 Description

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 🧐


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/imputnet/cobalt/pull/588 **Author:** [@teidesu](https://github.com/teidesu) **Created:** 6/25/2024 **Status:** ✅ Merged **Merged:** 7/24/2024 **Merged by:** [@wukko](https://github.com/wukko) **Base:** `current` ← **Head:** `ext-proxy` --- ### 📝 Commits (2) - [`ea69fd8`](https://github.com/imputnet/cobalt/commit/ea69fd8ded0cffa65fa58b27fd2c48724c72d90b) feat: support external proxies - [`3f8d5c2`](https://github.com/imputnet/cobalt/commit/3f8d5c22081a8a2a18850f07c7afc3e8fdea9c8e) fix: error when freebind is enabled ### 📊 Changes **3 files changed** (+13 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/run-an-instance.md` (+1 -0) 📝 `src/core/api.js` (+9 -0) 📝 `src/modules/config.js` (+3 -1) </details> ### 📄 Description 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 🧐 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-09 10:08:11 -06:00
Sign in to join this conversation.