node_shim.js 372 B

12345678910111213
  1. // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
  2. // SPDX-License-Identifier: MIT
  3. // This file adds RTCPeerConnection to the global context, making Node.js more
  4. // closely match the browser API for WebRTC.
  5. const wrtc = require('wrtc')
  6. global.window = {
  7. RTCPeerConnection: wrtc.RTCPeerConnection
  8. }
  9. global.RTCPeerConnection = wrtc.RTCPeerConnection