Skip to content

Conversation

@NiKrause
Copy link

@NiKrause NiKrause commented Nov 20, 2025

Closes #3034

This PR evaluates @roamhq/wrtc as a replacement for node-datachannel as requested in #3034.

Implementation

Replaced node-datachannel with two focused libraries:

  • @roamhq/wrtc for RTCPeerConnection (WebRTC peer connections)
  • stun package for STUN server (WebRTC Direct listener)

Changes

  • Replace node-datachannel RTCPeerConnection with @roamhq/wrtc
  • Implement STUN server using stun package for WebRTC Direct
  • Remove DirectRTCPeerConnection wrapper class
  • Add extractRemoteFingerprint helper for SDP parsing
  • Remove node-datachannel-specific GC workarounds
  • Add TypeScript definitions for stun package

Test Results

  • WebRTC transport functional
  • WebRTC Direct functional
  • Certificate management working
  • SDP manipulation validated

Known Issue

Segmentation fault during test cleanup - Native module crash in @roamhq/wrtc destructor. All tests pass before crash occurs. Does not affect functionality, only test harness cleanup.

Stack trace shows crash in RTCDataChannel::~RefPtr() and RTCPeerConnection::~RTCPeerConnection().

…p#3034)

Replace node-datachannel with @roamhq/wrtc for WebRTC peer connections
and stun package for STUN server functionality in WebRTC Direct.

Changes:
- Replace node-datachannel RTCPeerConnection with @roamhq/wrtc
- Implement STUN server using stun package for WebRTC Direct
- Remove DirectRTCPeerConnection wrapper class
- Add extractRemoteFingerprint helper for SDP parsing
- Remove node-datachannel-specific garbage collection workarounds
- Add TypeScript definitions for stun package

All unit tests pass (33 passing). WebRTC Direct functionality validated.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evaluate @roamhq/wrtc

1 participant