mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 05:40:35 +00:00
fix(telegram): preserve HTTP proxy env in global dispatcher workaround (#29940)
* fix(telegram): preserve HTTP proxy env in global dispatcher workaround * telegram: document request-scoped proxy dispatcher constraint * telegram: assert proxy path never mutates global dispatcher * changelog: credit telegram proxy env regression fix --------- Co-authored-by: Rylen Anil <rylen.anil@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import * as dns from "node:dns";
|
||||
import * as net from "node:net";
|
||||
import { Agent, setGlobalDispatcher } from "undici";
|
||||
import { EnvHttpProxyAgent, setGlobalDispatcher } from "undici";
|
||||
import type { TelegramNetworkConfig } from "../config/types.telegram.js";
|
||||
import { resolveFetch } from "../infra/fetch.js";
|
||||
import { createSubsystemLogger } from "../logging/subsystem.js";
|
||||
@@ -46,7 +46,7 @@ function applyTelegramNetworkWorkarounds(network?: TelegramNetworkConfig): void
|
||||
) {
|
||||
try {
|
||||
setGlobalDispatcher(
|
||||
new Agent({
|
||||
new EnvHttpProxyAgent({
|
||||
connect: {
|
||||
autoSelectFamily: autoSelectDecision.value,
|
||||
autoSelectFamilyAttemptTimeout: 300,
|
||||
|
||||
Reference in New Issue
Block a user