diff --git a/dist/proxies/multiSocket.js b/dist/proxies/multiSocket.js index fc5ba85..6a5f683 100644 --- a/dist/proxies/multiSocket.js +++ b/dist/proxies/multiSocket.js @@ -64,6 +64,9 @@ class MultiSocketProxy extends proxy_js_1.default { createDefaultMessage: false, ...options, }); + this._socketOptions.onchannel = this.handleNewPeerChannel.bind(this); + this._socketOptions.onclose = this.handleClosePeer.bind(this); + this._socketOptions.onopen = this.handlePeer.bind(this); if (options.socketClass) { this.socketClass = options.socketClass; } diff --git a/dist/proxy.d.ts b/dist/proxy.d.ts index 1bd61c1..3ff4540 100644 --- a/dist/proxy.d.ts +++ b/dist/proxy.d.ts @@ -6,9 +6,9 @@ export interface ProxyOptions extends DataSocketOptions { autostart?: boolean; } export default abstract class Proxy { - private _listen; - private _socketOptions; - private _autostart; + protected _listen: any; + protected _socketOptions: DataSocketOptions; + protected _autostart: boolean; constructor({ swarm, protocol, onopen, onreceive, onsend, onclose, onchannel, listen, autostart, emulateWebsocket, createDefaultMessage, }: ProxyOptions); private _swarm; get swarm(): any;