Skip to content

Instantly share code, notes, and snippets.

@mondain
Created March 12, 2026 13:40
Show Gist options
  • Select an option

  • Save mondain/9aa5d2ebeac38e2596c2337864cf52dd to your computer and use it in GitHub Desktop.

Select an option

Save mondain/9aa5d2ebeac38e2596c2337864cf52dd to your computer and use it in GitHub Desktop.
WHIP Restreamer

WHIP Restreamer

The WHIP Restreamer plugin provides a means to restream a stream to a remote server. The plugin is designed to work with servers that handle WHIP.

sequenceDiagram
    Ingest->>+ProStream: Ingested Stream (RTMP, RTSP, etc.)
    ProStream->>+WHIPRestreamListener: Listen for packets
    WHIPRestreamListener-->>+WHIPClient: Pass packets
    WHIPClient-->>+Dolby.io: Restream
Loading

Configuration

The WHIP Restreamer plugin is enabled via the restreamer-plugin.properties file; set the enable.whip field to true to enable the plugin (currently the default).

WHIP Push Provsion

Each example below covers the serviceProvider whether it be Red5 Pro Server, Twitch, or Dolby.io.

Red5 Pro

{
    "guid": "live/stream1",
    "context": "live",
    "name": "stream1",
    "level": 0,
    "parameters": {
        "type": "whip-push",
        "action": "create",
        "endpoint": "http://localhost:5080/live/whip/endpoint/stream2",
        "audio": true,
        "video": true,
        "datachannel": true,
        "insertableStream": false,
        "immediate": false,
        "attempts": 3,
        "delayS": 10,
        "persist": false
    }
}

Twitch

Twitch uses the bearerToken field for the stream key, which is found in your Twitch dashboard under Settings->Stream under Stream Key & Preferences.

{
    "guid": "live/stream1",
    "context": "live",
    "name": "stream1",
    "level": 0,
    "parameters":{
        "type": "whip-push",
        "action": "create",
        "serviceProvider": "twitch",
        "endpoint":"https://g.webrtc.live-video.net:4443/v2/offer",
        "bearerToken":"live_107484810_wnHKDftISXEIATEbGlCL2vwwaaqq",
        "audio": true,
        "video": true,
        "datachannel": false,
        "insertableStream": false,
        "immediate": false,
        "attempts": 3,
        "delayS": 10,
        "persist": false
    }
}

Example provisioning via curl (add your auth and update your stream key as needed)

curl -v -X POST http://localhost:5080/live/restream -H "Content-Type: application/json" -d '{"guid": "restream_twitch", "context": "live", "name": "stream1", "level": 0, "parameters": {"action": "create", "type": "whip-push", "serviceProvider": "twitch", "endpoint": "https://g.webrtc.live-video.net:4443/v2/offer", "bearerToken": "live_107484810_wnHKDftISXEIATEbGlCL2vmV5Xcmca", "audio": true, "video": true, "datachannel": false, "insertableStream": false, "immediate": "false", "attempts": "3", "delayS": "10", "persist": "false"}}'

Example of the standard kill request:

curl -v -X POST http://localhost:5080/live/restream -H "Content-Type: application/json" -d '{"guid": "restream_twitch", "context": "live", "name": "stream1", "level": 0, "parameters": {"action": "kill", "type": "whip-push"}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment