Using the WebRTC server

Updated: March 11, 2025

This chapter explains how to use WebRTC. It includes troubleshooting instructions and the utility reference for webrtc-server-iosock.

This chapter contains the following topics:

The WebRTC server provides a unified multimedia interface to the QNX target, accessible through a browser on your local development host. The WebRTC server displays the virtual display outputs (i.e., WFD driver outputs) and handles the host-side inputs (i.e., keyboard, pointer, or touch). Since WebRTC is a peer-to-peer connection protocol, QNX cloud targets require a TURN server to facilitate connections to and from the host-side.

By default, the QNX cloud target automatically runs the webrtc-server-iosock WebRTC utility, so you can immediately access the WebRTC interface.

Accessing the WebRTC interface

To access the WebRTC interface:
  1. Update the inbound rules of your QNX cloud target's security group to allow WebRTC and TURN servers to connect to the instance. For details, go to “Update security group rules” (External Site) in the Amazon EC2 User Guide.
  2. Go to https://<cloud_ip>:8443, where <cloud_ip> is the IP of your target and 8443 is the port number to the WebRTC server interface. Your display may look like this:

  3. Click Connect. Your display may look like this:

  4. Go to http://<cloud_ip>:8080, where <cloud_ip> is the IP of your target and 8080 is the port number to the reference digital cockpit display. Your display may look like this:

Navigating the WebRTC interface

You can start navigating the WebRTC interface and its features. You can interact with the camera and microphone buttons on the left-hand menu. For example:
  • WebRTC camera device

    You can select the camera icon to activate the video recording.

  • WebRTC microphone and recording device

    You can select and then hold down the microphone button to activate the audio recording (hold-to-talk).

Starting the WebRTC service manually

If necessary, you can manually run webrtc-server-iosock with the –external-ip= option to initialize an internal TURN server for all connections to the cloud target. This daemonizes all of the webrtc-server-iosock components on the system. For example, the following command runs WebRTC on the cloud target with the public IP of 11.22.33.44:
webrtc-server-iosock --external-ip=11.22.33.44
The internal TURN server also consumes the target's resources. This may be undesirable for many reasons. For example, you don't want the TURN server network traffic to affect the performance of the QNX cloud target. You can view the status output using slog2info.
To use an external TURN server, run webrtc-server-iosock with the --turn-server and --turn-user options. For example, the following command configures webrtc-server-iosock, and all its clients accessing the interface, to use a TURN server with the provided address and credentials:
webrtc-server-iosock --turn_server=turn:<my-turn-server-address>:3478
                     --turn_user=<my-username>:<my-credentials>
Note: The -external_ip and -turn_server options can't be used at the same time.

For other webrtc-server-iosock options (e.g., --camera_name), go to the webrtc-server-iosock utility reference.

Access the webrtc-server-iosock interface

To access the server on the host side, use the URL https://<cloud_ip>:<port_number> on a host browser, where <cloud_ip> is the IP of the target and <port_number> is the port of the proxy server (default is 8443).

Troubleshooting the WebRTC service

Use the following methods to help troubleshoot webrtc-server-iosock:
Test each component of webrtc-server-iosock independently
Run each of the following components independently to check for errors or warnings about any missing libraries:
  • /usr/libexec/webrtc-operator-iosock
  • /usr/libexec/webrtc-operator-proxy-iosock
  • /usr/libexec/turnserver-iosock
Run webrtc-server-iosock without daemonizing it
To run the non-daemonized server, use the following options:
  • to_stdout
    webrtc-server-iosock --to_stdout
  • verbose
    webrtc-server-iosock --verbose
Check the TURN server output logs
When using -external-ip to initialize the TURN server, TURN server logs output to /var/log/turn/* by default. You can adjust this log path setting with --turn_log_file= <filepath>. Make the TURN output verbose with --turn_verbose. To see everything on the command line including the webrtc-server-iosock output, use --to_stdout and --turn_verbose. For example:
webrtc-server-iosock --external-ip --turn_log_file="log.txt"
                     --to_stdout --turn_verbose