diff --git a/dist/netflux.es2015.js b/dist/netflux.es2015.js index 23c8b941..b737c4ae 100644 --- a/dist/netflux.es2015.js +++ b/dist/netflux.es2015.js @@ -2707,11 +2707,13 @@ class WebChannelGate { * @param {WebChannelGate~AccessData} accessData - Access data to join the * *WebChannel */ - open (onChannel, url) { + open (onChannel, options) { + let url = options.signaling + return new Promise((resolve, reject) => { let webRTCService = provide(WEBRTC) let webSocketService = provide(WEBSOCKET) - let key = this.generateKey() + let key = 'key' in options ? options.key : this.generateKey() webSocketService.connect(url) .then((ws) => { ws.onclose = (closeEvt) => { @@ -3013,7 +3015,7 @@ class WebChannel { return this.gate.open((channel) => { this.initChannel(channel) .then((channel) => this.addChannel(channel)) - }, settings.signaling) + }, settings) } /** diff --git a/dist/netflux.es2015.umd.js b/dist/netflux.es2015.umd.js index 745baa92..5e6216fe 100644 --- a/dist/netflux.es2015.umd.js +++ b/dist/netflux.es2015.umd.js @@ -2713,11 +2713,13 @@ * @param {WebChannelGate~AccessData} accessData - Access data to join the * *WebChannel */ - open (onChannel, url) { + open (onChannel, options) { + let url = options.signaling + return new Promise((resolve, reject) => { let webRTCService = provide(WEBRTC) let webSocketService = provide(WEBSOCKET) - let key = this.generateKey() + let key = 'key' in options ? options.key : this.generateKey() webSocketService.connect(url) .then((ws) => { ws.onclose = (closeEvt) => { @@ -3019,7 +3021,7 @@ return this.gate.open((channel) => { this.initChannel(channel) .then((channel) => this.addChannel(channel)) - }, settings.signaling) + }, settings) } /** diff --git a/src/WebChannel.js b/src/WebChannel.js index 9f8f6be2..96360ca3 100644 --- a/src/WebChannel.js +++ b/src/WebChannel.js @@ -243,7 +243,7 @@ class WebChannel { return this.gate.open((channel) => { this.initChannel(channel) .then((channel) => this.addChannel(channel)) - }, settings.signaling) + }, settings) } /** diff --git a/src/WebChannelGate.js b/src/WebChannelGate.js index e345c884..b4c49c5a 100644 --- a/src/WebChannelGate.js +++ b/src/WebChannelGate.js @@ -63,11 +63,13 @@ class WebChannelGate { * @param {WebChannelGate~AccessData} accessData - Access data to join the * *WebChannel */ - open (onChannel, url) { + open (onChannel, options) { + let url = options.signaling + return new Promise((resolve, reject) => { let webRTCService = provide(WEBRTC) let webSocketService = provide(WEBSOCKET) - let key = this.generateKey() + let key = 'key' in options ? options.key : this.generateKey() webSocketService.connect(url) .then((ws) => { ws.onclose = (closeEvt) => {