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

Function getSingboxUrlFromBackend

src/helper/utils.ts:74–79  ·  view source on GitHub ↗
(
  end: Pick<Backend, 'type' | 'protocol' | 'host' | 'port'>,
)

Source from the content-addressed store, hash-verified

72
73// sing-box native 后端复用顶层连接字段作为 gRPC baseUrl(secondaryPath 留空)。
74export const getSingboxUrlFromBackend = (
75 end: Pick<Backend, 'type' | 'protocol' | 'host' | 'port'>,
76) => {
77 if (end.type !== 'singbox' || !end.host) return ''
78 return `${end.protocol}://${end.host}:${end.port}`
79}
80
81export const getSingboxSecret = (end: Pick<Backend, 'type' | 'password'>) =>
82 end.type === 'singbox' ? end.password || '' : ''

Callers 6

backendKeyFunction · 0.90
getSingboxClientFunction · 0.90
probeSingboxChannelFunction · 0.90
[Symbol.asyncIterator]Function · 0.90
ensureSessionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected