Screen-Share Relay (TURN)
The built-in WebRTC technician screen-share connects the operator's browser directly to the target machine whenever the network allows it. When the two sides sit behind restrictive NAT or firewalls and a direct path can't be formed, Athena can route the media through a coturn TURN relay — a well-known, firewall-deterministic path that keeps screen-share working. This page covers configuring that relay and standing one up on a managed Linux host with a single click.
In the shipped default, screen-share is direct-first and the relay is left out of the media path. A relay is optional — configure one only when you need reliable screen-share across networks where a direct connection can't be established.
How the relay fits in#
When a screen-share session starts, the browser and the target agent attempt to negotiate the most direct media path available. If a relay is configured, the server mints short-lived relay credentials and hands both sides the relay address so media can fall back to the relay when a direct route fails. The relay never sees session content in the clear beyond forwarding the encrypted media stream — it exists to guarantee connectivity, not to inspect traffic.
Running the relay involves two independent pieces:
- Relay settings — the address, port, transport, and shared secret Athena uses to mint relay credentials. These are saved in the console under Settings → Agents → Remotes → WebRTC Screen Share.
-
The relay host — a machine running
coturnthat matches those settings. You can point at an existing coturn deployment, or let Athena provision one onto a managed Linux agent.
Configuring relay settings#
Under Settings → Agents → Remotes → WebRTC Screen Share, enable the integration
and fill in the relay endpoint. The individual fields are composed into a single
turn:host:port?transport=… URI when you save:
| Setting | Config key | Default | Purpose |
|---|---|---|---|
| Enable screen-share | RemoteSession:WebRtcEnabled | true | Master switch for the WebRTC technician screen-share |
| Scheme | RemoteSession:Turn:Scheme | turn | turn or turns |
| Host | RemoteSession:Turn:Host | empty | Relay hostname or IP reachable by both operator and agent |
| Port | RemoteSession:Turn:Port | 3478 | Relay listening port |
| Transport | RemoteSession:Turn:Transport | udp | udp or tcp |
| Credential TTL | RemoteSession:Turn:CredentialTtlSeconds | 600 | Lifetime of the minted, time-limited relay credentials |
| Static auth secret | RemoteSession:Turn:StaticAuthSecret | empty | Shared secret that must match the relay's static-auth-secret |
The static auth secret is sensitive. For unattended deployments it is supplied out-of-band via
the environment variable RemoteSession__Turn__StaticAuthSecret rather than being
committed to a configuration file. The value must match the static-auth-secret on the
relay, and the server and relay clocks must agree (NTP) for the time-limited credentials to
validate.
One-click relay provisioning#
Rather than build a relay host by hand, Athena can stand up coturn on a machine you already manage. On the same WebRTC Screen Share settings screen, an Admin-only section lets you pick an online Linux agent and click Configure relay. Athena renders a coturn setup script from your saved relay settings and runs it on the selected agent over the existing secure agent channel — there is no SSH, no extra port to open, and no separate credential to manage.
Before provisioning, make sure that:
- You have saved the relay host and static auth secret — the script is built from these; provisioning is refused if they are blank.
- The target is a Linux agent and is online. Windows agents and offline agents are rejected.
- The agent can reach a package source to install coturn if it isn't already present (relevant in air-gapped environments — see Air-Gapped Operation).
The provisioning run is idempotent and, on the target host, will:
- Install
coturnif it isn't already installed, then enable its service flag. - Write
/etc/turnserver.confwith your host and secret, the fixed media port range49160–49200, and secret-based authentication. This file is overwritten on every run so a settings change takes effect. - Open the relevant UDP ports in the host firewall only if
ufwis already active (it never enables the firewall for you). - Enable and restart the coturn service so the configuration is live.
Success is confirmed by an explicit health marker the script emits only when the coturn service is actually running — a zero exit code alone is not treated as success. If the marker isn't reported within the provisioning window, the action is reported as failed. When it succeeds, Athena automatically runs a Test Connection against the new relay and shows the result inline.
Verifying with Test Connection#
The Test Connection button on the WebRTC Screen Share settings probes the configured relay and reports whether it is reachable and whether the shared secret is accepted:
| Result field | Meaning |
|---|---|
| Reachable & credential accepted | The relay answered and validated the minted credential — screen-share can fall back to it |
| Relay address | The relay's server-reflexive/relay address returned by the probe |
| Latency | Round-trip time to the relay, in milliseconds, when available |
| Not configured | No relay URI is set — this is the normal direct-first state, shown as an informational (not error) status |
If Test Connection fails right after a successful provision, the most common causes are a secret mismatch between the server settings and the relay, or clock skew between the two hosts. Confirm both sides use the same secret and are time-synced. The same relay check is available per agent from Screen-Share Diagnostics, alongside the agent's helper version and last-session history.
REST API#
Provisioning is also available over the REST API for scripted rollouts. The relay host and secret come from the saved settings, so there is no request body:
| Action | Endpoint | Role |
|---|---|---|
| Provision coturn onto a Linux agent | POST api/agents/{agentId}/provision-relay | Admin |
The response body reports the outcome:
| Field | Meaning |
|---|---|
success | Whether the relay came up (driven by the health marker, not the exit code alone) |
markerFound | Whether the success marker was reported by the agent |
exitCode | Exit code from the provisioning run, when available |
output | Tail of the run's output (the secret is never echoed) |
relayTest | The follow-up Test Connection result on success |
message | Human-readable summary of the outcome |
A provisioning failure returns HTTP 200 with success=false in
the body. Non-200 responses are reserved for authorization, validation (not a Linux agent, or
offline), and agent-not-found errors.
PowerShell#
The Athena PowerShell module exposes provisioning as a single cmdlet so you can stand up (or re-apply) a relay from a script or the pipeline:
| Cmdlet | What it does |
|---|---|
Install-AthenaRelay | Provisions coturn onto the specified online Linux agent (-AgentId) using the saved relay settings; requires Admin |
# Provision the relay onto a specific Linux agent
Install-AthenaRelay -AgentId "12345678-1234-1234-1234-123456789012"
# Or pipe the target in from Get-AthenaAgent
Get-AthenaAgent -Hostname "relay-host" | Install-AthenaRelay
The cmdlet returns the same result fields as the API (success, marker found, output, and the follow-up Test Connection), and re-running it simply re-applies the current settings — handy after you change the relay host, port, or secret.
Auditing#
Every provisioning action is written to the audit log with the target agent, the initiating user, the relay host and port, whether the success marker was found, and the overall result. The shared secret and the setup script itself are never recorded — only the redacted metadata is stored — so the audit trail is safe to forward to a SIEM.
Provisioning configures the selected agent as a shared media relay for screen-share. Choose a Linux host with a stable, reachable address that both operators and target machines can connect to on the configured port, and keep its clock in sync with the Athena server.