github.com/pion/webrtc/v3@v3.2.24/test-wasm/node_shim.js (about)

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