Skip to content

Live video infrastructure for developers.

Ingest a stream over RTMP, package it as HLS, and track it from publish to playback. One pipeline, three endpoints.

The pipeline

One stream, five stages.

  1. 01

    Broadcaster

    OBS or any RTMP-capable encoder publishes the stream.

  2. 02

    RTMP ingestion

    Node-Media-Server accepts the publish on port 1935.

  3. 03

    Stream processing

    The API owns the stream record; the media server marks it live on publish and starts the recorder.

  4. 04

    HLS packaging

    Node-Media-Server segments the stream and serves the manifest on port 8080.

  5. 05

    Viewer

    A browser player loads the HLS manifest and plays the stream.

Core capabilities

What the platform handles.

RTMP stream ingestion

Encoders publish to a stream key on port 1935. Node-Media-Server accepts the connection and exposes the media path.

HLS playback delivery

The same server writes HLS segments and a manifest any browser-compatible player can load.

Stream lifecycle

Creating, publishing, and ending a stream are separate steps. The server updates liveness when a publisher connects or disconnects.

Status and session tracking

Status, viewer count, and metrics endpoints exist for the dashboard. Their values are not yet verified against a working stream.

Architecture

Separate processes, explicit responsibilities.

Service boundaries

Encoder (OBS / FFmpeg)
  │ RTMP
  ▼
NMS :1935 ──publish──▶ API :5000
  │ HLS                  │ Mongoose
  ▼                      ▼
NMS :8080 ──m3u8──▶ Browser   MongoDB
  │
  └─ FFmpeg ──▶ recordings / VOD

Browser ──REST──────▶ API :5000
        ──Socket.IO─▶ API :5000

NMS = Node-Media-Server
Next.js app
Landing page, login, and the auth route. The legacy Vite app still hosts the dashboard during migration.
Express API
Owns stream records, profiles, metrics, and validation. Session checks and role gates sit in front of stream routes.
Node-Media-Server
Accepts RTMP on 1935 and serves HLS on 8080. Publish and disconnect callbacks update liveness and recording.
FFmpeg
Records the published RTMP source to disk when a stream goes live. Output directories are not statically served yet.
MongoDB
Stores users, streams, chat, and payment records. Stream.creator is an ObjectId reference to a user.
Socket.IO
Carries viewer counts, stream metrics, and chat events. The current server trusts client-supplied user ids.

FAQ

Questions the page should answer.

What is Tunnel?

A developer-facing live streaming platform. It accepts RTMP from an encoder, serves HLS to viewers, and keeps a stream record that an API can query from create to end.

How do RTMP and HLS work together?

RTMP is the input from your encoder. Node-Media-Server receives it and writes HLS segments plus a manifest. HLS is the output a browser player can load, which is why the encoder and viewer use different endpoints.

How can I test a stream today?

Run MongoDB, the backend, and an encoder. Publish to rtmp://localhost:1935/live with an existing stream key, then open the manifest at http://localhost:8080/live/<streamKey>/index.m3u8. Creating a new stream through the API is currently blocked by a creator-id cast error, so use a key already in the database.

What is supported right now?

RTMP ingestion and HLS serving are implemented. The stream lifecycle, status endpoints, and dashboard exist but are not verified end to end. Authentication is mid-migration, and the public Next.js app does not yet include the dashboard.

Start with one stream.

Create an account, configure a key, and point an encoder at the ingest endpoint. The setup notes cover the pieces that still need manual steps.