Wowza Streaming Engine (WSE) can ingest and deliver audio and video over WebRTC, and can transmux or transcode WebRTC to HLS, MPEG-DASH, RTMP, or RTSP. It can also ingest a non-WebRTC source and play it back over WebRTC (alone or alongside HTTP-based protocols like HLS). This article covers publishing and playing a stream over WebRTC with all major desktop and mobile browsers that support the WebRTC APIs.
Encryption is mandatory for WebRTC, so you must configure TLS before streaming.
Send a WebRTC stream
Prerequisites
- WSE 4.11+.
- When upgrading from an earlier version of WSE, some configuration files must be manually updated.
- Create a live app.
- Review the supported codecs and browsers.
- Configure TLS on your WSE instance.
When using Firefox with a 127.0.0.1 loopback address, you must enable media.peerconnection.ice.loopback in the browser's configuration settings.
1. Configure TLS encryption
Because of cross-domain restrictions, you must secure the browser-to-server SDP exchange with a TLS certificate and enable WebRTC WebSocket signaling on the TLS host port. You may configure TLS encryption using WSE Manager or by editing your server's Vhost.xml configuration file.
Configure TLS in WSE Manager
- Open WSE Manager.
- Click the Server tab.
- Select Virtual Host Setup.
- Click Edit.
- Under Host Ports, click the edit icon for your SSL/TLS port.
- Select Use WebRTC WebSocket Signaling.
- Click Apply.
- Under WebRTC WebSocket Implementation, select WebRTC.
- Click Save
- Restart the virtual host.
Configure TLS in Vhost.xml
Open your server's [install-dir]/conf/VHost.xml file. In the <HTTPProviders> container of your TLS <HostPort> element, add the WebRTC signaling provider as the second-to-last entry. This enables WebRTC on the port.
<HTTPProvider>
<BaseClass>com.wowza.wms.webrtc2.http.HTTPWebRTCSignalingRouter</BaseClass>
<RequestFilters>*webrtc-session.json</RequestFilters>
<AuthenticationMethod>none</AuthenticationMethod>
</HTTPProvider>
Note: If you upgraded from an earlier version and an older WebRTC provider is already present, update it instead of adding a new one.
Select your preferred WebRTC implementation. Set <SelectedVersion> to v2 (current), legacy, or dynamic:
<!-- WebRTC signaling implementation: legacy | v2 | dynamic -->
<WebRTC>
<SelectedVersion>v2</SelectedVersion>
</WebRTC>The 443 SSL/TLS host port is commented out by default. If you need it, comment it back in by removing the surrounding <!-- 443 with SSL -->, <!--, and --> lines.
Save the file and restart Wowza Streaming Engine.
2. Enable WebRTC for your application
With signaling enabled on the TLS port, enable WebRTC for your live app using either WSE Manager or the app's Application.xml configuration settings.
Enable WebRTC in WSE Manager
On the Applications tab, select your live application, click WebRTC, and on the Setup tab click Edit. Configure the following WebRTC Enabled Features, as needed.
- Publish WebRTC to Wowza Streaming Engine: Allow this app to ingest WebRTC source streams.
- Play WebRTC from Wowza Streaming Engine: Allow this app to deliver WebRTC streams.
- Query published stream names: Allow the names of this app's published WebRTC streams to be queried.
- Enable WHIP/WHEP: Enable the standards-based HTTP WHIP and WHEP endpoints. This allows standard clients to publish and play without WebSocket signaling.
- Enable Debug Logging: Enable detailed logging of the DTLS handshake, SDP negotiation, UDP port assignment, and session lifecycle. Takes effect at the next application start.
Click Save and restart the application.
Enable WebRTC in Application.xml
Open [install-dir]/conf/[application-name]/Application.xml and configure the <WebRTC> container element. See the <WebRTC> section of the Application.xml reference page for available configuration settings and their descriptions. The XML snippet below is a full example of the <WebRTC> element:
Save and restart Wowza Streaming Engine.
Note: We recommend disabling B-frames for WebRTC streams. With Wowza Streaming Engine 4.8.14 and later, the Transcoder adds B-frames by default — see Configure B-frame generation in Wowza Streaming Engine.
3. Connect a publisher and player
Clients can reach a WebRTC-enabled application two ways: WebSocket (WSS) signaling, which is enabled by default, or the standards-based WHIP and WHEP endpoints, which require Enable WHIP/WHEP to be selected in step 2.
WebSocket (WSS) signaling
Clients exchange SDP over the signaling URL you enabled in step 1:
wss://[ssl-domain]:[ssl-port]/webrtc-session.json
Include the port unless you're using the default 443. Clients also supply the application name and a stream name. Publishers choose the stream name, players use the same one to subscribe. See the GitHub WebRTC examples for publish and play implementations.
WHIP and WHEP
The current WebRTC stack supports WebRTC HTTP ingestion protocol (WHIP) and WebRTC HTTP egress protocol (WHEP). This allows clients such as OBS Studio, FFmpeg, and GStreamer to publish and play directly without a custom integration. After WHIP and WHEP are enabled for an application (step 2), the endpoints are:
- WHIP (publish):
https://[ssl-domain]:[ssl-port]/<application>/<stream>/whip - WHEP (play):
https://[ssl-domain]:[ssl-port]/<application>/<stream>/whep
Point a WHIP-capable encoder at the WHIP endpoint to publish, and a WHEP-capable player at the WHEP endpoint to play the same application and stream.
Add bearer token authentication (optional)
Authentication is disabled by default; an endpoint with no token stays open. When a token is set, clients must include a bearer token (Authorization: Bearer <token>) with each request. Missing or incorrect tokens will be rejected with a 401 Unauthorized error. Note that WHIP and WHEP tokens are independent, meaning a playback token cannot be used to publish. You can set up bearer tokens using WSE Manager or directly in the app's configuration file, as shown in the steps below.
- WSE Manager:
- Open WSE Manager.
- Open the app's WebRTC page.
- Click Edit.
- Scroll to the WHIP/WHEP Authentication section.
- Enter or generate WHIP Bearer Token (Publish).
- Enter or generate WHEP Bearer Token (Play).
- Click Save.
- Restart the app.
- Application.xml:
- Open your app's
[install-dir]/conf/[application-name]/Application.xmlfile. - In the
<WebRTC>/<Properties>container, add awebrtcWhipBearerTokenproperty and/or awebrtcWhepBearerTokenproperty. - Restart the app.
- Open your app's
4. Configure additional properties (Optional)
The defaults are enough to publish and play, but you can tune WebRTC behavior by adding properties to your application's Application.xml file. Properties are available for STUN and TURN servers, FIR, session timeouts, jitter buffering, packet loss logging, and H.264 SDP compatibility.
For the full list of available options, see WebRTC properties.
5. Test the WebRTC workflow
In production, WebRTC pages must be hosted on a server using SSL/TLS. For testing, use the Wowza-hosted test pages, also reachable from the application's WebRTC Setup page via Wowza Hosted Test Pages.
Both test pages default to WebSocket signaling. To use WHIP or WHEP instead, select it as the publishing or playback method. The pages will then expect the HTTPS form of the signaling URL rather than the WSS form.
Publish a test stream
Open the hosted WebRTC publish test page and enter the Application Name matching your WebRTC application, plus a unique Stream Name.
- WebSocket: Enter the WSS signaling URL from step 3
wss://[ssl-domain]:[ssl-port]/webrtc-session.json. For example, the following URL uses port 443 and uses StreamLock:wss://5ab4321c0d123.streamlock.net/webrtc-session.json - WHIP: Select WHIP, then enter the HTTPS signaling URL from step 3
https://[ssl-domain]:[ssl-port]. The page builds the rest of the endpoint from the application and stream names. If the app requires a bearer token, enter it in the Token field. Optionally add STUN/TURN or trickle ICE details.
Click Publish.
Tip: The frame rate/size settings constrain the camera input and aren't in the SDP; the browser may adjust the frame rate for network conditions. After publishing, use the arrow next to the camera icon to share your screen. Click Copy config to share settings with another browser or device.
Play a test stream
In a new tab, open the hosted WebRTC play test page and use the same Application Name and Stream Name you used when you published the test stream.
- WebSocket: Use the same WSS signaling URL you used to publish the test stream. If you use SecureToken playback security, complete the Secure Token Data fields. (Note: SecureToken playback is not yet functional available with WHIP/WHEP publishing.)
- WHEP: Select WHEP, then enter the same HTTPS signaling URL you used to publish the test stream . If the application requires a bearer token, enter it in the Token field.
Click Play.
Tip: For production playback, consider the Wowza Flowplayer Real-Time Streaming (WebRTC) plugin. To test other protocols, enable them under Playback Types on the application's Setup tab and use that protocol's playback URL.
Send a WebRTC stream (legacy implementation)
The legacy implementation continues to work unchanged in 4.11.0. To use it, set WebRTC WebSocket Implementation to Legacy WebRTC in Manager, or <SelectedVersion>legacy</SelectedVersion> in VHost.xml. To run both and choose per client, use Dynamic and include ?webrtcImplementation=v2 in the signaling URL for clients that should use the current implementation.
Legacy limitations that don't apply to the current implementation:
- No full STUN negotiation — only symmetric NAT traversal via a single STUN transport supplied in
IceCandidateIpAddresses; TURN isn't supported. - Firefox requires UDP; TCP isn't supported.
- With UDP ICE candidates, enabling NACK is recommended for retransmission of lost packets.
Next steps
- Ingest a non-WebRTC stream for WebRTC playback
- Manage access
- Record a WebRTC stream
- Optimize WebRTC stream performance
Known issues
- SecureToken playback protection is not yet functional in the current WebRTC stack. To protect streams with SecureToken, run the application on the legacy stack until this is resolved.




