Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (that.iceGatheringState === 'complete') {
var nullCandidate = new RTCIceCandidate();
nullCandidate.candidate = null;
that.onicecandidate(nullCandidate);
} else {
checkIceState();
}
}, 1000).unref();
})(); // miserable hack, waiting for https://github.com/js-platform/node-webrtc/issues/44
};
util.inherits(RTCPeerConnection, webrtc.RTCPeerConnection);
GLOBAL.RTCPeerConnection = RTCPeerConnection;
GLOBAL.RTCIceCandidate = webrtc.RTCIceCandidate;
GLOBAL.RTCSessionDescription = webrtc.RTCSessionDescription;
GLOBAL.DataChannel = webrtc.DataChannel;
var CustomWebSocket = function(url) {
if (!(this instanceof WebSocket)) {
return new CustomWebSocket(url);
}
var websocketClient = new WebSocketClient();
var that = this;
websocketClient.on('connect', function(connection) {
connection.on('message', function(msg) {
msg.data = msg.utf8Data;
that.onmessage(msg);
});
that.send = function(msg) {
connection.send(msg);
};
});