MCPcopy Index your code
hub / github.com/plotly/dash / buildWebSocketUrl

Function buildWebSocketUrl

dash/dash-renderer/src/observers/websocketObserver.ts:269–280  ·  view source on GitHub ↗

* Build the WebSocket URL from config.

(config: DashConfig)

Source from the content-addressed store, hash-verified

267 * Build the WebSocket URL from config.
268 */
269function buildWebSocketUrl(config: DashConfig): string {
270 if (!config.websocket?.url) {
271 throw new Error('WebSocket URL not configured');
272 }
273
274 // Convert HTTP(S) URL to WS(S)
275 const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
276 const host = window.location.host;
277
278 // The config.websocket.url is a path like "/_dash-ws-callback"
279 return `${wsProtocol}//${host}${config.websocket.url}`;
280}
281
282/**
283 * Disconnect from the WebSocket.

Callers 1

initializeWebSocketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…