openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 876 B
JavaScript
import{l as isRecord}from"./record-coerce-BTbqdJ3-.mjs";import{t as resolveActiveManagedProxyTlsOptions}from"./active-managed-proxy-tls-BvfPVgaU.mjs";
//!src/infra/net/proxy/managed-proxy-undici.ts
function readProxyTlsRecord(e){if(!e||!(`proxyTls`in e))return;return isRecord(e.proxyTls)?e.proxyTls:void 0}function readProxyUrlFromOptions(e){if(!e)return;if(`uri`in e){const t=e.uri;return t instanceof URL?t.href:typeof t===`string`?t:void 0}if(`httpsProxy`in e||`httpProxy`in e){const t=Reflect.get(e,`httpsProxy`);const n=Reflect.get(e,`httpProxy`);return typeof t===`string`?t:typeof n===`string`?n:void 0}}function addActiveManagedProxyTlsOptions(e,t){const n=resolveActiveManagedProxyTlsOptions({proxyUrl:readProxyUrlFromOptions(e),env:t?.env});if(!n)return e;const r=readProxyTlsRecord(e);return{...e,proxyTls:{...n,...r}}}export{addActiveManagedProxyTlsOptions as t};