# `CCXT.WS.URLRouting`
[🔗](https://github.com/ZenHive/ccxt_client/blob/main/lib/ccxt/ws/url_routing.ex#L1)

Pure URL resolution for WebSocket endpoints.

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

URLs come from `CCXT.WS.Config` today. When ccxt_extract starts emitting
`runtime.describe.urls.api.ws` this module will read from the spec instead.

# `private_url`

```elixir
@spec private_url(CCXT.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`

```elixir
@spec public_url(CCXT.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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
