---
title: "Real Time"
description: "TunnelHub broker and native WSS transport for Ring Platform"
locale: "ru"
---
# Realtime Transport

- **TunnelHub** (`lib/tunnel/hub/`) — SSE, native WSS, poll, channel subscriptions
- **server.ts** — custom Next entrypoint + `attachTunnelWss` when `RING_DEPLOY_TARGET` ≠ `vercel`
- **Client** — `useTunnel` / `TunnelProvider` with WSS → SSE → poll fallback
- **Presence, typing, notifications** — `publishToChannel` / `publishToUserTunnel`

```mermaid
flowchart LR
  Client -->|WSS or SSE| server.ts
  server.ts --> TunnelHub
  TunnelHub --> Services
  Services --> PostgreSQL
```

See [Tunnel protocol](/docs/features/tunnel-protocol.md) (EN) for `RING_DEPLOY_TARGET` and routes.
