# Transports

URL: https://docs.folkways.io/docs/realtime-api/transports

WebSocket, HTTP publish and HTTP long-polling, which to use when, and WebTransport, which is planned.

The Realtime API serves every transport on one host, over TLS on port 443, so it works on networks that allow only
HTTPS. All transports share the same tokens, frames and error codes.

<Diagram name="transports" alt="Your client reaches the Realtime API on one host with TLS on port 443 over WebSocket at GET /v1/ws, for live delivery both ways; HTTP publish at POST /v1/publish, to publish without a connection; and HTTP long-poll at POST /v1/poll, to receive where WebSockets are blocked. WebTransport over HTTP/3 is planned and not available yet." />

| Transport | Endpoint | Direction | Use it for |
| --- | --- | --- | --- |
| **WebSocket** | `wss://…/v1/ws` | Both, live | Apps and browsers: publishing, subscribing, presence |
| **HTTP publish** | `POST https://…/v1/publish` | Client to server | Backends, serverless functions, scripts; clients without a socket |
| **HTTP long-poll** | `POST https://…/v1/poll` | Server to client | Receiving where WebSockets are blocked by a proxy or firewall |
| **WebTransport** | | | **Planned.** Not available yet |

## WebSocket [#websocket]

The default for apps. One connection carries many topics in both directions, with live delivery, presence and token
refresh. See [WebSocket](/docs/realtime-api/websocket).

## HTTP publish [#http-publish]

A stateless `POST` with a token in the `Authorization` header and up to 64 publishes in the body. Nothing to keep
open, so it suits backends and serverless functions. It can't subscribe. See
[`POST /v1/publish`](/docs/realtime-api/publish#post-v1publish).

## HTTP long-poll [#http-long-poll]

A stateless read: send cursors, get events after them, waiting up to 25 seconds for something new. Use it where
WebSockets don't get through. It doesn't count toward presence, and signals between polls are best effort. See
[`POST /v1/poll`](/docs/realtime-api/poll).

The JavaScript SDK uses WebSocket first and falls back to long-polling plus HTTP publish after repeated WebSocket
failures, then tries WebSocket again later. See [Connection](/docs/js-sdk/connection#transports).

## WebTransport (planned) [#webtransport-planned]

WebTransport over HTTP/3 (QUIC) is planned as another transport for apps. It isn't available yet and has no release
date; this page will say when it is. Build on WebSocket and HTTP today.

## Turning transports off [#turning-transports-off]

A segment can refuse a transport: see [Transports in the Console](/docs/console/segments#transports).
