Files
webrtc/test-wasm/node_shim.js
2024-07-01 16:08:21 -04:00

14 lines
380 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('@roamhq/wrtc')
global.window = {
RTCPeerConnection: wrtc.RTCPeerConnection
}
global.RTCPeerConnection = wrtc.RTCPeerConnection