element-hq / element-hq/synapse

Allow specifying STUN server (without TURN servers)

Open
#15,581 0 comments 0 reactions 0 assignees View on GitHub
O-Uncommon S-Tolerable T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#15581](https://github.com/matrix-org/synapse/issues/15581).

---

**Description:**

I want to use a public `STUN` server, such as `stun.nextcloud.com:443` or `stun.l.google.com:19302` respectively. So following https://github.com/matrix-org/synapse/blob/def480442d752f1951cf7f790be873489a09c432/docs/turn-howto.md#synapse-setup I set my `turn_uris` to `["stun:stun.nextcloud.com:443"]` and restarted Synapse.

**Expected outcome:**

`_matrix/client/r0/voip/turnServer`
```json
{
"uris": [
"stun:stun.nextcloud.com:443"
]
}
```

**Actual outcome:**

`_matrix/client/r0/voip/turnServer` returns an empty JSON `{}`

---

Only when supplying all other configuration options (`turn_shared_secret`, `turn_user_lifetime`, `turn_allow_guests`) with a value as well, Synapse starts giving back the corresponding URIs when calling `_matrix/client/r0/voip/turnServer`.

I'm actually unsure if it's working at all then, but making use of `STUN` should be possible without using `TURN`, right?

Contributor guide

Open the contributing guide

Research direction

Start with the _matrix/client/r0/voip/turnServer endpoint and the turn_uris configuration described in docs/turn-howto.md. Reproduce the response using only a STUN URI, then trace how the endpoint handles configurations without TURN options. Done means the endpoint returns the configured STUN URI without requiring unrelated TURN settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.