diff --git a/package.json b/package.json index 90a5ec5..95c31db 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "import-sync": "^2.2.0", "lodash": "^4.17.21", "mockttp": "^3.2.1", - "node-datachannel": "^0.5.3", + "node-datachannel": "^0.12.0", "performance-now": "^2.1.0", "sdp-transform": "^2.14.1" }, diff --git a/src/webrtc/rtc-connection.ts b/src/webrtc/rtc-connection.ts index b1ad8bd..2f2479e 100644 --- a/src/webrtc/rtc-connection.ts +++ b/src/webrtc/rtc-connection.ts @@ -448,7 +448,7 @@ export class RTCConnection extends EventEmitter { this.localDescription = undefined; if (rawConn.state() === 'closed') return; - rawConn.destroy(); + rawConn.close(); this.emit('connection-closed'); }