External ingest
Register an authorized upstream feed or track an external encoder.
On this page
Use the source registry to pull an existing HLS feed into RelayRTC or track a push encoder's lifecycle. Your application must have permission to redistribute the source.
| Protocol | Attached stream | Behavior |
|---|---|---|
hls_pull | RTMP | Worker fetches and republishes an approved HLS feed |
rtmp_push | RTMP | Registry monitors an external RTMP publisher |
whip_push | WHIP | Registry monitors an external WHIP publisher |
The registry does not support SRT, RTMP pull or arbitrary HTTP video files. See streaming ingest for encoder credentials.
Allow upstream hosts
An operator must configure STREAMING_SOURCE_ALLOWED_HOSTS with exact public hostnames, including playlist, segment and redirect hosts. An empty allowlist disables pulls. The source worker must be deployed alongside the normal streaming services.
Only public HTTP/HTTPS endpoints on ports 80 or 443 are allowed. Private addresses, metadata endpoints and playback-to-ingest loops are rejected. Redirects are checked individually; HTTPS cannot downgrade to HTTP. An Authorization header is forwarded only to the original origin.
Register and probe
This backend helper accepts an application-approved upstream URL, not an arbitrary URL passed directly by a viewer:
import { relay } from './relay.js'
export async function prepareHlsSource(streamId: string, approvedUrl: string) {
const source = await relay.restreamSources.create({
streamId,
name: 'Remote studio',
protocol: 'hls_pull',
endpoint: approvedUrl,
redistributionAuthorized: true,
})
await relay.restreamSources.probe(source.id)
return source.id
}Poll restreamSources.get(sourceId) until the probe becomes ready or failed. Start a successful source with restreamSources.start(sourceId), then wait for observed live media. Probe success checks the input at that time; it does not guarantee future availability.
Supported feeds
HLS pulls require unencrypted H.264/AAC with independently decodable segments, using MPEG-TS or fragmented MP4. Encrypted playlists, byte-range media, LL-HLS partial segments, content steering and variable substitution are not supported. Supply a normal compatible media feed rather than a player page URL.
Store upstream authentication through the registry's authorization field when needed. Reads expose safe host/protocol metadata, not the original URL or secret. Do not put upstream credentials in browser code or logs.
Push registry sources
For rtmp_push or whip_push, omit endpoint and authorization. Starting the registry source waits for the publisher; it does not launch the encoder. Connect within its admission window. Stopping revokes attached ingest authority, so obtain a new credential before reconnecting.
Continue with restreaming operations. See source REST APIs for complete request and response fields.