Spaces:
Sleeping
Sleeping
Download src/lib/network/initOutboundProxy.js from automindy/sdkongwang: direct link, hf CLI and curl.
- Browser
- Download file 677 Bytes
-
https://huggingface.co/spaces/automindy/sdkongwang/resolve/main/src/lib/network/initOutboundProxy.js
- Command line
-
hf download hf://spaces/automindy/sdkongwang/src/lib/network/initOutboundProxy.js
-
curl -L -o initOutboundProxy.js https://huggingface.co/spaces/automindy/sdkongwang/resolve/main/src/lib/network/initOutboundProxy.js
677 Bytes
| import { getSettings } from "@/lib/localDb"; | |
| import { applyOutboundProxyEnv } from "@/lib/network/outboundProxy"; | |
| let initialized = false; | |
| export async function ensureOutboundProxyInitialized() { | |
| if (initialized) return true; | |
| try { | |
| const settings = await getSettings(); | |
| applyOutboundProxyEnv(settings); | |
| initialized = true; | |
| } catch (error) { | |
| console.error("[ServerInit] Error initializing outbound proxy:", error); | |
| } | |
| return initialized; | |
| } | |
| // Defer init so HTTP server accepts connections first | |
| setImmediate(() => { | |
| ensureOutboundProxyInitialized().catch(console.log); | |
| }); | |
| export default ensureOutboundProxyInitialized; | |