Skip to main content
Stream Manager 2.0 is the centralized control plane for Red5 Pro cluster deployments. It handles node provisioning, load balancing, auto-scaling, failover, and geographic distribution so that your application always routes publishers and subscribers to the most appropriate server node. Every interaction with your cluster — starting streams, finding an available origin, or assigning edge nodes to viewers — passes through the Stream Manager API.

How Stream Manager 2.0 works

Stream Manager sits between your client applications and the pool of Red5 Pro media nodes. When a publisher requests a server to stream to, Stream Manager selects an available origin node and returns its address. When a viewer requests a server to subscribe from, Stream Manager selects the best available edge node based on current load and geographic proximity.

Node management

Provisions, monitors, and terminates origin, edge, relay, and transcoder nodes in response to load.

Load balancing

Distributes publishers and subscribers across available nodes to prevent any single server from becoming a bottleneck.

Auto-scaling

Scales the node pool up when capacity thresholds are exceeded and down when demand decreases.

Failover

Detects unhealthy nodes and reroutes traffic to healthy ones automatically.

Geo distribution

Routes clients to the geographically nearest node to reduce latency.

REST API

Exposes authenticated REST endpoints for stream management, node queries, and cluster provisioning.

Installation

Stream Manager 2.0 is deployed as part of the Red5 Pro cluster, most commonly through the official Terraform modules. Terraform handles provisioning the Stream Manager host, configuring the database backend, and bootstrapping the node group. For full installation steps, see the Stream Manager 2.0 installation overview.

Finding the Stream Manager URL

After a Terraform deployment completes, the Stream Manager URL is printed in the Terraform output. Look for a value like:
stream_manager_url = "https://sm.example.com:443"
If you deployed to a cloud provider directly without Terraform, find the public IP or DNS name assigned to the Stream Manager host in your cloud provider’s console, then append the port (default 443 for HTTPS or 5080 for HTTP).
Save the Stream Manager URL as an environment variable in your deployment environment so your application can reference it without hard-coding the address.

Admin credentials

Stream Manager 2.0 uses JWT-based authentication. The initial admin credentials are set during installation. If you deployed with Terraform, the credentials appear in the Terraform output or in the secrets you provided as input variables. To retrieve credentials after a Terraform deployment:
terraform output stream_manager_admin_user
terraform output stream_manager_admin_password
Change the default admin password immediately after your first login. The default credentials are well known and must not remain in place on any internet-accessible deployment.

API authentication

All Stream Manager 2.0 API requests require a JWT bearer token. You obtain the token by posting your credentials to the authentication endpoint.

Obtain a JWT token

curl -X POST "https://sm.example.com/as/v1/auth/login" \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "your-password"}'
The response includes an accessToken field:
{
  "accessToken": "eyJhbGciOiJSUzI1NiJ9...",
  "tokenType": "Bearer",
  "expiresIn": 3600
}
Include the token in the Authorization header of every subsequent request:
curl -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
  "https://sm.example.com/as/v1/streams"

Core API endpoints

The Stream Manager REST API is organized around two primary use cases: finding a server for a publisher, and finding a server for a subscriber.

Get a server for publishing

Before a publisher connects to your cluster, your application calls this endpoint to receive the origin node address the publisher should connect to.
curl -X GET \
  "https://sm.example.com/as/v1/streams/live/{streamName}/publish" \
  -H "Authorization: Bearer {accessToken}"
A successful response returns the connection details for the assigned origin node:
{
  "serverAddress": "203.0.113.10",
  "scope": "live",
  "name": "myStream",
  "port": 1935,
  "protocol": "rtmp"
}

Get a server for subscribing

Before a viewer connects to consume a stream, your application calls this endpoint to receive the edge node address the subscriber should connect to.
curl -X GET \
  "https://sm.example.com/as/v1/streams/live/{streamName}/subscribe" \
  -H "Authorization: Bearer {accessToken}"
{
  "serverAddress": "203.0.113.55",
  "scope": "live",
  "name": "myStream",
  "port": 443,
  "protocol": "wss"
}

End-to-end example

The following example shows a complete publish flow: authenticate, request an origin node, and connect a publisher.
const SM_URL = "https://sm.example.com";
const STREAM_NAME = "myStream";

// Step 1: Authenticate
const authResponse = await fetch(`${SM_URL}/as/v1/auth/login`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ username: "admin", password: "your-password" }),
});
const { accessToken } = await authResponse.json();

// Step 2: Get an origin node for publishing
const nodeResponse = await fetch(
  `${SM_URL}/as/v1/streams/live/${STREAM_NAME}/publish`,
  { headers: { Authorization: `Bearer ${accessToken}` } }
);
const { serverAddress, port } = await nodeResponse.json();

// Step 3: Connect your publisher to the returned address
console.log(`Publish to: rtmp://${serverAddress}:${port}/live/${STREAM_NAME}`);

Node group management

You can query the current state of your node group to inspect how many nodes are active and what their roles are.

List active nodes

curl -X GET "https://sm.example.com/as/v1/nodegroups" \
  -H "Authorization: Bearer {accessToken}"

Inspect a specific node group

curl -X GET "https://sm.example.com/as/v1/nodegroups/{nodeGroupName}" \
  -H "Authorization: Bearer {accessToken}"
Node group names are defined in your Terraform configuration or Stream Manager launch configuration. Use the exact name you specified during deployment.