Compare commits
3 Commits
f8b8633287
...
422c11b9b8
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 422c11b9b8 | |
Derrick Hammer | b2b041c3a1 | |
Derrick Hammer | d63fa22d00 |
|
@ -64,6 +64,9 @@ class MultiSocketProxy extends proxy_js_1.default {
|
||||||
createDefaultMessage: false,
|
createDefaultMessage: false,
|
||||||
...options,
|
...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) {
|
if (options.socketClass) {
|
||||||
this.socketClass = options.socketClass;
|
this.socketClass = options.socketClass;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,9 @@ export interface ProxyOptions extends DataSocketOptions {
|
||||||
autostart?: boolean;
|
autostart?: boolean;
|
||||||
}
|
}
|
||||||
export default abstract class Proxy {
|
export default abstract class Proxy {
|
||||||
private _listen;
|
protected _listen: any;
|
||||||
private _socketOptions;
|
protected _socketOptions: DataSocketOptions;
|
||||||
private _autostart;
|
protected _autostart: boolean;
|
||||||
constructor({ swarm, protocol, onopen, onreceive, onsend, onclose, onchannel, listen, autostart, emulateWebsocket, createDefaultMessage, }: ProxyOptions);
|
constructor({ swarm, protocol, onopen, onreceive, onsend, onclose, onchannel, listen, autostart, emulateWebsocket, createDefaultMessage, }: ProxyOptions);
|
||||||
private _swarm;
|
private _swarm;
|
||||||
get swarm(): any;
|
get swarm(): any;
|
||||||
|
|
|
@ -80,6 +80,9 @@ export default class MultiSocketProxy extends Proxy {
|
||||||
createDefaultMessage: false,
|
createDefaultMessage: false,
|
||||||
...options,
|
...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) {
|
if (options.socketClass) {
|
||||||
this.socketClass = options.socketClass;
|
this.socketClass = options.socketClass;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -9,9 +9,9 @@ export interface ProxyOptions extends DataSocketOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default abstract class Proxy {
|
export default abstract class Proxy {
|
||||||
private _listen: any;
|
protected _listen: any;
|
||||||
private _socketOptions: DataSocketOptions;
|
protected _socketOptions: DataSocketOptions;
|
||||||
private _autostart: boolean;
|
protected _autostart: boolean;
|
||||||
|
|
||||||
constructor({
|
constructor({
|
||||||
swarm,
|
swarm,
|
||||||
|
|
Loading…
Reference in New Issue