spantaleev / matrix-docker-ansible-deploy

🐳 Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker
GNU Affero General Public License v3.0
4.9k stars 1.04k forks source link

Feature Request: Enhanced Support for TURN Multiplexing with Cloudflare Calls in Jitsi Meet Deployment #3483

Open gitayam opened 2 months ago

gitayam commented 2 months ago

Background:

I'm currently setting up a TURN server to optimize one-to-one calls in Jitsi Meet, aiming to bypass the Jitsi Videobridge (JVB) where possible. As part of this setup, I am integrating a TURN server with a multiplexing setup using Nginx to ensure compatibility with networks that only allow TCP connections on port 443. I have chosen to use Cloudflare Calls TURN service as part of my infrastructure, which requires configuring TURN multiplexing properly.

Request:

I would like to request enhanced support for integrating Cloudflare Calls into the existing Jitsi Meet deployment playbook, with a focus on the following areas:

  1. TURN Multiplexing Configuration:

    • Modify the roles that would go into matrix-docker-ansible-deploy/inventory/domain/vars.yml playbook to include configuration options for TURN multiplexing with Cloudflare Calls.
    • Provide support for easy configuration of Nginx or other reverse proxies to manage multiplexing for WebRTC PeerConnections.
  2. TURN Server Integration:

    • Add support for using Cloudflare’s TURN servers instead of self-hosted ones.
    • Ensure the roles/matrix-coturn and roles/jitsi playbooks can be easily configured to use Cloudflare's global network infrastructure for TURN.
  3. Documentation Update:

    • Provide documentation and examples in the docs/configuring-playbook-turn.md and docs/configuring-playbook-jitsi.md files for setting up Cloudflare Calls with TURN multiplexing.
    • Update examples in examples/reverse-proxies/nginx to reflect Cloudflare integration and multiplexing configurations.

Code Snippet for inventory/vars.yml:

matrix_coturn_enabled: false
matrix_synapse_turn_uris:
  - "stun:stun.cloudflare.com:3478"
  - "turn:turn.cloudflare.com:3478?transport=udp"
  - "turn:turn.cloudflare.com:3478?transport=tcp"
  - "turns:turn.cloudflare.com:5349?transport=tcp"

This configuration disables the self-hosted coturn server and uses Cloudflare's TURN and STUN services instead. These services will route WebRTC traffic through Cloudflare's network for optimal performance.

Link to Cloudflare Calls Documentation:

Possible Files Affected:

Expected Outcome:

By implementing these features, users can benefit from improved call quality, reduced latency, and increased connection stability, particularly in restricted network environments. Leveraging Cloudflare's infrastructure will enhance the overall performance of Jitsi Meet deployments for global users.

Some users are of course not looking to use cloudflare more than needed so providing this as a non default option would be ideal.

Thank you for considering this feature request.