Low Latency Streaming (LLS/WebRTC) Functions
Low Latency Streaming (LLS/WebRTC) Functions
Low Latency Streaming (LLS/WebRTC) Functions
Cloud Functions supports the ability to stream video, audio, and other data using WebRTC.

For complete examples of LLS streaming functions, contact your NVIDIA representative for access to sample function containers.
WebRTC streaming uses UDP NodePort services to carry media traffic between the browser client and the streaming application. Cloud providers apply network security rules at multiple layers. If any layer blocks UDP inbound traffic on the NodePort range (30000-32767), streaming sessions fail even though the function shows ACTIVE.
AKS attaches two Network Security Groups (NSGs) to every node: one on the
subnet and one on the NIC in the managed resource group
(MC_<resource-group>_<cluster>_<region>). Both NSGs must allow inbound UDP
traffic on the NodePort range. The subnet NSG alone is not sufficient.
After helmfile sync completes, add the NIC NSG rule:
Verify the rules are present:
If the NIC NSG rule is missing, WebRTC clients receive
NVST_R_GENERIC_ERROR while the function remains ACTIVE. See
streaming-troubleshooting
for diagnosis steps.
For LLS streaming on EKS, security group and NLB configuration is covered in LLS Installation.
The streaming application needs to be packaged inside a container and should be leveraging the StreamSDK. The streaming application needs to follow the below guidelines:
Expose an HTTP server at port CONTROL_SERVER_PORT with following 2 endpoints:
Health endpoint: This endpoint should return 200 HTTP status code only when the streaming application container is ready to start streaming a session. If the streaming application container doesn’t want to serve any more streaming sessions of current container deployment this endpoint should return HTTP status code 500.
STUN creds endpoint: This endpoint should accept the access details and credentials for STUN server and keep it cached in the memory of the streaming application. When the streaming requests comes, the streaming application can use these access details and credentials to communicate with STUN server and request for opening of ports for streaming.
Expose a server at port STREAMING_SERVER_PORT to accepting WebSocket connection
STREAMING_START_ENDPOINT should be exposed by this serverPost websocket connection establishment guidelines:
STREAMING_PORT_BINDING_RANGE in this doc.Containerization guidelines:
CONTROL_SERVER_PORT, STREAMING_SERVER_PORT and STREAMING_PORT_BINDING_RANGE are exposed by the container and accessible from outside the container.When creating the function, ensure functionType is set to STREAMING:
An intermediary proxy service needs to be deployed in order to facilitate the connection to the streaming function.
The intermediate proxy serves to handle authentication and the headers that are required for NVCF, and also to align the connection behavior with NVCF that the browser can’t handle on its own, or the browser behavior is unpredictable.
Proxy Responsibilities
The intermediary proxy performs the following functionalities:
NVCF_API_KEY and STREAMING_FUNCTION_ID)Technical Implementation Guidance
nvcf-function-id Header
NVCF requires this header to be present to identify the function that needs to be reached. Browser does not have the mechanism to set any kind of headers in case of WebSocket connections other than Sec-Websocket-Protocol, so the intermediate proxy can serve to either add the nvcf-function-id header on its own, or to parse Sec-Websocket-Protocol if the browser added it there and get the function id from there.
See http-request add-header documentation in HAProxy.
Authentication
The role of intermediate proxy is to add the required server authentication (e.g. http-request set-header Authorization "Bearer NVCF_BEARER_TOKEN").
Connection Keepalive
NVCF controls the session lifetime based on the TCP connection lifetime to the function and the type of disconnection that happens. The intermediate proxy helps to keep the connection with the browser alive.
Resume Support
NVCF returns the cookie with nvcf-request-id, but given the browser may reject the cookie since it is not from the same domain, the intermediate proxy helps to align this.
CORS Headers
For browsers to allow traffic with NVCF, the intermediate proxy needs to add the relevant CORS headers to responses from NVCF:
access-control-expose-headers: *access-control-allow-headers: *access-control-allow-origin: *For guidance on implementing this in HAProxy, see http-response set-header documentation.
Example HAProxy Dockerfile
Below is an all-in-one Dockerfile sample for setting up an HAProxy intermediary proxy with optional TLS/SSL support:
This example focuses on NVCF integration. In production, you should also implement user authentication and authorization to control access to your streaming function.
For certain applications, TLS/SSL support is required. The proxy can be configured to use self-signed certificates for development and testing purposes by setting PROXY_SSL_INSECURE=true.
Update NVCF_SERVER to point to your gateway address. See gateway-routing for details.
Environment Variables
The following environment variables control proxy behavior:
Usage Examples
1. HTTP Mode (Default)
Standard configuration without SSL:
2. HTTPS Mode with Self-Signed Certificate
Configuration with SSL enabled using a self-signed certificate:
Since this configuration uses self-signed certificates for development and testing, you will need to configure your client to accept untrusted certificates. In production environments, you should use proper CA-signed certificates.
Using the proxy, a browser client can be used to connect to the stream.
The browser client needs to be developed by the customer leveraging the raganrok dev branch 0.0.1503 version. Please ensure that the flags are set: