Broadcast Streams

A broadcast stream creates a websocket server allowing the user to connect third-party apps or custom logic to a Listener source. A stream requires: name in source_id.

{
  "target_type": "websocket",
  "source_id": "84757abc-ba43-5736-0ba3-1bdac4748290",
    "name": "my websocket"
}

Elements are returned when a stream is created and provides you with the following client connection details:

{
    "data_path": {
        "secret": "ffafef69-43cf-44b8-a3c4-80a93808ac4f",
        "url": "https://listener-streamer-services-myenv.example.com/v1/streamer/e5925443-ec1c-4fd4-ada8-8d8c6c603cee",
        "websocket": "wss://listener-streamer-services-myenv.example.com/v1/streamer/e5925443-ec1c-4fd4-ada8-8d8c6c603cee"
    },
    "name": "my websocket",
    "source_id": "96bcaa82-6091-4e96-aee5-cc3fe2015bae",
    "target_id": "e5925443-ec1c-4fd4-ada8-8d8c6c603cee",
    "target_type": "websocket"
}

To connect to a stream, send a websocket handshake request to the returned URL with the correct authorization header. The following is an example using HTTP header to pass secret key:


curl -k -i -N -H "Connection: Upgrade" -H "Authorization: secret {secret key}" -H "Upgrade: websocket" -H "Host: listener-streamer-services-aus103.ln.uda.io" -H "Origin: listener-streamer-services-aus103.ln.uda.io" https://listener-streamer-services-aus103.ln.uda.io/v1/streamer/9cc889b0-8e41-4f68-be20-575c0a81048a

The following is an example using URI query parameter to pass secret key:

curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: listener-streamer-services-aus103.ln.uda.io" -H "Origin: listener-streamer-services-aus103.ln.uda.io" https://listener-streamer-services-aus103.ln.uda.io/v1/streamer/9cc889b0-8e41-4f68-be20-575c0a81048a?secret={secret key}

The following is an example wss protocol:

wss://listener-streamer-services-myenv.example.com/v1/streamer/e5925443-ec1c-4fd4-ada8-8d8c6c603cee?secret={secret key}

results matching ""

    No results matching ""