@@ -30,8 +30,9 @@ required for Element Call to work properly:
30
30
sync v2 API that allows them to correctly track the state of the room. This is
31
31
required by Element Call to track room state reliably.
32
32
33
- If you're using [ Synapse] ( https://github.com/element-hq/synapse/ ) as your homeserver, you'll need
34
- to additionally add the following config items to ` homeserver.yaml ` to comply with Element Call:
33
+ If you're using [ Synapse] ( https://github.com/element-hq/synapse/ ) as your
34
+ homeserver, you'll need to additionally add the following config items to
35
+ ` homeserver.yaml ` to comply with Element Call:
35
36
36
37
``` yaml
37
38
experimental_features :
@@ -64,35 +65,88 @@ required for each site deployment.
64
65
65
66

66
67
67
- As depicted above, Element Call requires a
68
+ As depicted above in the ` example.com` site deployment , Element Call requires a
68
69
[Livekit SFU](https://github.com/livekit/livekit) alongside a
69
70
[Matrix Livekit JWT auth service](https://github.com/element-hq/lk-jwt-service)
70
71
to implement
71
72
[MSC4195 : MatrixRTC using LiveKit backend](https://github.com/hughns/matrix-spec-proposals/blob/hughns/matrixrtc-livekit/proposals/4195-matrixrtc-livekit.md).
72
73
74
+ # ### Matrix site endpoint routing
75
+
76
+ In the context of MatrixRTC, we suggest using a single hostname for backend
77
+ communication by implementing endpoint routing within a reverse proxy setup. For
78
+ the example above, this results in :
79
+ | Service | Endpoint | Example |
80
+ | -------- | ------- | ------- |
81
+ | [Livekit SFU](https://github.com/livekit/livekit) WebSocket signalling connection | `/livekit/sfu` | `matrix-rtc.example.com/livekit/sfu` |
82
+ | [Matrix Livekit JWT auth service](https://github.com/element-hq/lk-jwt-service) | `/livekit/jwt` | `matrix-rtc.example.com/livekit/jwt` |
83
+
84
+ Using Nginx, you can achieve this by :
85
+
86
+ ` ` ` jsonc
87
+ server {
88
+ ...
89
+ location ^~ /livekit/jwt/ {
90
+ proxy_set_header Host $host;
91
+ proxy_set_header X-Real-IP $remote_addr;
92
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
93
+ proxy_set_header X-Forwarded-Proto $scheme;
94
+
95
+ # JWT Service running at port 8080
96
+ proxy_pass http://localhost:8080/;
97
+ }
98
+
99
+ location ^~ /livekit/sfu/ {
100
+ proxy_set_header Host $host;
101
+ proxy_set_header X-Real-IP $remote_addr;
102
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
103
+ proxy_set_header X-Forwarded-Proto $scheme;
104
+
105
+ proxy_send_timeout 120;
106
+ proxy_read_timeout 120;
107
+ proxy_buffering off;
108
+
109
+ proxy_set_header Accept-Encoding gzip;
110
+ proxy_set_header Upgrade $http_upgrade;
111
+ proxy_set_header Connection "upgrade";
112
+
113
+ # LiveKit SFU websocket connection running at port 7880
114
+ proxy_pass http://localhost:7880/;
115
+ }
116
+ }
117
+ ` ` `
118
+
119
+ # ### MatrixRTC backend announcement
120
+
73
121
> [!IMPORTANT]
74
122
> As defined in
75
123
> [MSC4143](https://github.com/matrix-org/matrix-spec-proposals/pull/4143)
76
- > MatrixRTC backend must be announced to the client via your **homeserver's
77
- > ` .well-known/matrix/client`**. The configuration is a list of Foci configs:
124
+ > MatrixRTC backend must be announced to the client via your **Matrix site's
125
+ > `.well-known/matrix/client`** file (e.g.
126
+ > `example.com/.well-known/matrix/client` matching the site deployment example
127
+ > from above). The configuration is a list of Foci configs:
78
128
79
129
` ` ` json
80
130
"org.matrix.msc4143.rtc_foci": [
81
131
{
82
132
"type": "livekit",
83
- "livekit_service_url": "https://someurl .com"
133
+ "livekit_service_url": "https://matrix-rtc.example .com"
84
134
},
85
- {
135
+ {
86
136
"type": "livekit",
87
- "livekit_service_url": "https://livekit2 .com"
137
+ "livekit_service_url": "https://matrix-rtc-2.example .com"
88
138
},
89
139
{
90
- "type": "another_foci ",
91
- "props_for_another_foci ": "val"
140
+ "type": "nextgen_new_foci_type ",
141
+ "props_for_nextgen_foci ": "val"
92
142
}
93
143
]
94
144
` ` `
95
145
146
+ > [!NOTE]
147
+ > Most `org.matrix.msc4143.rtc_foci` configurations will only have one entry in
148
+ > the array
149
+
96
150
# # Building Element Call
97
151
98
152
> [!NOTE]
0 commit comments