MCPcopy
hub / github.com/Zephyruso/zashboard / getSingboxClient

Function getSingboxClient

src/api/singbox/client.ts:36–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34 `${backend.uuid}|${getSingboxUrlFromBackend(backend)}|${getSingboxSecret(backend)}`
35
36export const getSingboxClient = (): SingboxClient | null => {
37 const backend = activeBackend.value
38 const baseUrl = backend ? getSingboxUrlFromBackend(backend) : ''
39 if (!backend || !baseUrl) {
40 current = null
41 return null
42 }
43 const key = backendKey(backend)
44 if (current?.key === key) return current.client
45 current = { key, client: new SingboxClient(baseUrl, getSingboxSecret(backend)) }
46 return current.client
47}
48
49// Probe the sing-box channel for the Setup connectivity test.
50export const probeSingboxChannel = async (backend: Backend, timeout = 10000): Promise<boolean> => {

Callers 11

ensureSessionFunction · 0.90
handlerProxySelectFunction · 0.90
proxyLatencyTestFunction · 0.90
proxyGroupLatencyTestFunction · 0.90
allProxiesLatencyTestFunction · 0.90
closeSingboxConnectionFunction · 0.90
fetchSingboxConfigsFunction · 0.90
updateConfigsFunction · 0.90
fetchSingboxVersionFunction · 0.85
fetchSingboxStartedAtFunction · 0.85

Calls 3

getSingboxUrlFromBackendFunction · 0.90
getSingboxSecretFunction · 0.90
backendKeyFunction · 0.85

Tested by

no test coverage detected