Compare commits

...

2 Commits

Author SHA1 Message Date
Derrick Hammer d94eec7c7e
*update dist 2023-02-25 22:21:39 -05:00
Derrick Hammer 68cd8008a6
*add emulateWebsocket to proxy 2023-02-25 22:21:09 -05:00
3 changed files with 17 additions and 4 deletions

2
dist/proxy.d.ts vendored
View File

@ -9,7 +9,7 @@ export default class Proxy {
private _listen;
private _socketOptions;
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;
get swarm(): any;
private _protocol;

10
dist/proxy.js vendored
View File

@ -9,12 +9,18 @@ class Proxy {
_listen;
_socketOptions;
_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._protocol = protocol;
this._listen = listen;
this._autostart = autostart;
this._socketOptions = { onopen, onreceive, onsend, onclose };
this._socketOptions = {
onopen,
onreceive,
onsend,
onclose,
emulateWebsocket,
};
this.init();
}
_swarm;

View File

@ -22,12 +22,19 @@ export default class Proxy {
onclose,
listen = false,
autostart = false,
emulateWebsocket = false,
}: ProxyOptions) {
this._swarm = swarm;
this._protocol = protocol;
this._listen = listen;
this._autostart = autostart;
this._socketOptions = { onopen, onreceive, onsend, onclose };
this._socketOptions = {
onopen,
onreceive,
onsend,
onclose,
emulateWebsocket,
};
this.init();
}