Bourse.WS.URLRouting (bourse v0.1.0)

Copy Markdown View Source

Pure URL resolution for WebSocket endpoints.

Given a %Bourse.Exchange{}, returns the public or private WS URL appropriate for the current sandbox flag, with {hostname} interpolated from exchange.hostname.

URLs come from Bourse.WS.Config, which prefers resolved websocket.urls from the spec and falls back to hand-maintained bases when absent.

Summary

Functions

Private WS URL for the given exchange, or nil if the exchange has no WS config or no private endpoint.

Public WS URL for the given exchange, or nil if the exchange has no WS config.

Functions

private_url(exchange)

@spec private_url(Bourse.Exchange.t()) :: String.t() | nil

Private WS URL for the given exchange, or nil if the exchange has no WS config or no private endpoint.

public_url(exchange)

@spec public_url(Bourse.Exchange.t()) :: String.t() | nil

Public WS URL for the given exchange, or nil if the exchange has no WS config.

Honors exchange.sandbox — returns the sandbox URL when the flag is true and a sandbox URL is configured.