Compare commits
2 Commits
6b42c2400f
...
d94eec7c7e
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | d94eec7c7e | |
Derrick Hammer | 68cd8008a6 |
|
@ -9,7 +9,7 @@ export default class Proxy {
|
||||||
private _listen;
|
private _listen;
|
||||||
private _socketOptions;
|
private _socketOptions;
|
||||||
private _autostart;
|
private _autostart;
|
||||||
constructor({ swarm, protocol, onopen, onreceive, onsend, onclose, listen, autostart, }: ProxyOptions);
|
constructor({ swarm, protocol, onopen, onreceive, onsend, onclose, listen, autostart, emulateWebsocket, }: ProxyOptions);
|
||||||
private _swarm;
|
private _swarm;
|
||||||
get swarm(): any;
|
get swarm(): any;
|
||||||
private _protocol;
|
private _protocol;
|
||||||
|
|
|
@ -9,12 +9,18 @@ class Proxy {
|
||||||
_listen;
|
_listen;
|
||||||
_socketOptions;
|
_socketOptions;
|
||||||
_autostart;
|
_autostart;
|
||||||
constructor({ swarm, protocol, onopen, onreceive, onsend, onclose, listen = false, autostart = false, }) {
|
constructor({ swarm, protocol, onopen, onreceive, onsend, onclose, listen = false, autostart = false, emulateWebsocket = false, }) {
|
||||||
this._swarm = swarm;
|
this._swarm = swarm;
|
||||||
this._protocol = protocol;
|
this._protocol = protocol;
|
||||||
this._listen = listen;
|
this._listen = listen;
|
||||||
this._autostart = autostart;
|
this._autostart = autostart;
|
||||||
this._socketOptions = { onopen, onreceive, onsend, onclose };
|
this._socketOptions = {
|
||||||
|
onopen,
|
||||||
|
onreceive,
|
||||||
|
onsend,
|
||||||
|
onclose,
|
||||||
|
emulateWebsocket,
|
||||||
|
};
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
_swarm;
|
_swarm;
|
||||||
|
|
|
@ -22,12 +22,19 @@ export default class Proxy {
|
||||||
onclose,
|
onclose,
|
||||||
listen = false,
|
listen = false,
|
||||||
autostart = false,
|
autostart = false,
|
||||||
|
emulateWebsocket = false,
|
||||||
}: ProxyOptions) {
|
}: ProxyOptions) {
|
||||||
this._swarm = swarm;
|
this._swarm = swarm;
|
||||||
this._protocol = protocol;
|
this._protocol = protocol;
|
||||||
this._listen = listen;
|
this._listen = listen;
|
||||||
this._autostart = autostart;
|
this._autostart = autostart;
|
||||||
this._socketOptions = { onopen, onreceive, onsend, onclose };
|
this._socketOptions = {
|
||||||
|
onopen,
|
||||||
|
onreceive,
|
||||||
|
onsend,
|
||||||
|
onclose,
|
||||||
|
emulateWebsocket,
|
||||||
|
};
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue