Files
deepseek-harness/packages/util/http-proxy/src/index.ts
T
2026-11-02 12:59:03 +00:00

27 lines
1.1 KiB
TypeScript

/**
* Outbound HTTP proxy support for DeepSeek Harness.
*
* Node's built-in `fetch` ignores `HTTP_PROXY` and friends, so every harness request would connect
* directly no matter what the user exported. The launcher resolves one policy from the launch
* environment and installs it as undici's global dispatcher, which is what `fetch` resolves — so
* LLM adapters, web search, MCP over HTTP, and telemetry are covered without touching their code.
*
* This is a library, not a plugin: transport policy has one answer per process, so there is nothing
* for a composition to mount, swap, or scope.
*
* Five functions, one per way a caller needs the policy — install it, build a dispatcher with its
* own transport choices, ask how to send one request, build a child's environment, and strip the
* ambient one for a replay.
* @module @deepseek-ai/dsh-http-proxy
*/
export {
clearedProxyEnv,
createRouteDispatcher,
installProxyFromEnvironment,
proxyEnvironmentForChild,
proxyRouteFor,
type DispatcherOptions,
type ProxyRoute,
} from './install.ts'