Compare commits
3 Commits
f89e2716f5
...
1d4cb917c5
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 1d4cb917c5 | |
Derrick Hammer | 08b4bbc893 | |
Derrick Hammer | 3b7be7e892 |
|
@ -18,9 +18,10 @@ export default class Socket extends Duplex {
|
||||||
writable: true;
|
writable: true;
|
||||||
remotePublicKey: Uint8Array;
|
remotePublicKey: Uint8Array;
|
||||||
private _emulateWebsocket;
|
private _emulateWebsocket;
|
||||||
addEventListener: typeof this.addListener;
|
addEventListener?: typeof this.addListener;
|
||||||
removeEventListener: typeof this.removeListener;
|
removeEventListener?: typeof this.removeListener;
|
||||||
send: typeof this.write;
|
send?: typeof this.write;
|
||||||
|
close?: typeof this.end;
|
||||||
constructor({ allowHalfOpen, remoteAddress, remotePort, remotePublicKey, write, emulateWebsocket, }?: SocketOptions);
|
constructor({ allowHalfOpen, remoteAddress, remotePort, remotePublicKey, write, emulateWebsocket, }?: SocketOptions);
|
||||||
private _connecting;
|
private _connecting;
|
||||||
get connecting(): boolean;
|
get connecting(): boolean;
|
||||||
|
|
|
@ -29,6 +29,7 @@ class Socket extends streamx_1.Duplex {
|
||||||
this.addEventListener = this.addListener;
|
this.addEventListener = this.addListener;
|
||||||
this.removeEventListener = this.removeListener;
|
this.removeEventListener = this.removeListener;
|
||||||
this.send = this.write;
|
this.send = this.write;
|
||||||
|
this.close = this.end;
|
||||||
this.addEventListener("data", (data) =>
|
this.addEventListener("data", (data) =>
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.emit("message", new MessageEvent("data", { data })));
|
this.emit("message", new MessageEvent("data", { data })));
|
||||||
|
|
|
@ -32,9 +32,10 @@ export default class Socket extends Duplex {
|
||||||
public remotePublicKey: Uint8Array;
|
public remotePublicKey: Uint8Array;
|
||||||
private _emulateWebsocket: boolean;
|
private _emulateWebsocket: boolean;
|
||||||
|
|
||||||
declare addEventListener: typeof this.addListener;
|
declare addEventListener?: typeof this.addListener;
|
||||||
declare removeEventListener: typeof this.removeListener;
|
declare removeEventListener?: typeof this.removeListener;
|
||||||
declare send: typeof this.write;
|
declare send?: typeof this.write;
|
||||||
|
declare close?: typeof this.end;
|
||||||
|
|
||||||
constructor({
|
constructor({
|
||||||
allowHalfOpen = false,
|
allowHalfOpen = false,
|
||||||
|
@ -64,6 +65,7 @@ export default class Socket extends Duplex {
|
||||||
this.addEventListener = this.addListener;
|
this.addEventListener = this.addListener;
|
||||||
this.removeEventListener = this.removeListener;
|
this.removeEventListener = this.removeListener;
|
||||||
this.send = this.write;
|
this.send = this.write;
|
||||||
|
this.close = this.end;
|
||||||
this.addEventListener("data", (data: any) =>
|
this.addEventListener("data", (data: any) =>
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.emit("message", new MessageEvent("data", { data }))
|
this.emit("message", new MessageEvent("data", { data }))
|
||||||
|
|
Loading…
Reference in New Issue