MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / buildWsUrl

Function buildWsUrl

apps/kimi-web/src/api/config.ts:83–88  ·  view source on GitHub ↗
(origin: string, clientId: string)

Source from the content-addressed store, hash-verified

81}
82
83export function buildWsUrl(origin: string, clientId: string): string {
84 const url = new URL(`${origin}/api/v1/ws`);
85 url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
86 url.searchParams.set('client_id', clientId);
87 return url.toString();
88}
89
90function getClientId(): string {
91 const stored = safeGetString(CLIENT_ID_KEY);

Callers 1

connectEventsMethod · 0.90

Calls 2

setMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected