Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RTCConfig for WebRTCTransport #2554

Closed
justin0mcateer opened this issue May 24, 2024 · 0 comments · Fixed by #2590 or #2585
Closed

Update RTCConfig for WebRTCTransport #2554

justin0mcateer opened this issue May 24, 2024 · 0 comments · Fixed by #2590 or #2585
Labels
kind/enhancement A net-new feature or improvement to an existing feature

Comments

@justin0mcateer
Copy link

  • Version:
    "libp2p": "^1.2.4",
    "@libp2p/webrtc": "^4.0.22",

  • Platform:
    Linux master 6.8.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 13 Apr 2024 14:42:24 +0000 x86_64 GNU/Linux

  • Subsystem:
    WebRTCTransport

Severity:

Medium

Description:

Currently, the RTC configuration can only be set at the time of construction of the WebRTCTransport. While this is typically fine for STUN servers and the like, TURN servers often have credentials which are limited in their lifetime. For libp2p peers which are long lived, the peer (and thus the Transport instance) may outlive the validity of the TURN credential.

Since the initially provided credential is used each time the 'dial' method is called on the transport, eventually the Transport will not be able to request TURN candidates.

Steps to reproduce the error:

  1. Leverage any common TURN service such as Twilio, Cloudflare, Metered.ca, etc
  2. Request a credential with a short lifetime (eg 180 seconds)
  3. Create a libp2p instance with a WebRTCTransport including the provided TURN credentials
  4. Observe that TURN cadidates are no longer available after the libp2p instance lifetime exceeds the credential lifetime
@justin0mcateer justin0mcateer added the need/triage Needs initial labeling and prioritization label May 24, 2024
achingbrain added a commit that referenced this issue Jun 14, 2024
In order to allow refreshing STUN/TURN credentials between dials,
allow passing a function that returns rtc config.

Fixes #2554
@achingbrain achingbrain added kind/enhancement A net-new feature or improvement to an existing feature and removed need/triage Needs initial labeling and prioritization labels Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
2 participants