Skip to content

Support TURN REST API (Shared Secret) Authentication#2073

Open
lowlyocean wants to merge 1 commit intoAlexxIT:masterfrom
lowlyocean:dynamic_rest_API_credentials
Open

Support TURN REST API (Shared Secret) Authentication#2073
lowlyocean wants to merge 1 commit intoAlexxIT:masterfrom
lowlyocean:dynamic_rest_API_credentials

Conversation

@lowlyocean
Copy link

Closes #500

Pion's turn/v4 library (already an indirect dependency) provides GenerateLongTermTURNRESTCredentials() which generates time-limited HMAC-SHA1 credentials from a shared secret — exactly what coturn expects.

3 files with minimal changes:

webrtc.go : custom ICEServerConfig struct with shared_secret and credential_ttl fields, a resolveICEServers() function that generates fresh credentials per connection, and moving config resolution into the PeerConnection closure
go.mod : promote pion/turn/v4 to direct dependency
schema.json : add the new fields to the JSON schema

Usage:

webrtc:
  ice_servers:
    - urls: [stun:stun.l.google.com:19302]
    - urls: [turn:my-coturn:3478]
      shared_secret: "my-secret"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

usage of TURN server with shared secret

2 participants