Files
webrtc/test-wasm/node_shim.js
2023-05-05 11:58:49 -04:00

14 lines
372 B
JavaScript

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