Compare commits
2 Commits
3ce2313c5a
...
10d3c1fde8
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 10d3c1fde8 | |
Derrick Hammer | 108e1b3dd8 |
|
@ -4,6 +4,7 @@ interface SocketOptions {
|
||||||
allowHalfOpen?: boolean;
|
allowHalfOpen?: boolean;
|
||||||
remoteAddress?: string;
|
remoteAddress?: string;
|
||||||
remotePort?: number;
|
remotePort?: number;
|
||||||
|
remotePublicKey?: Uint8Array;
|
||||||
write?: (this: Duplex<any, any, any, any, true, true, DuplexEvents<any, any>>, data: any, cb: Callback) => void;
|
write?: (this: Duplex<any, any, any, any, true, true, DuplexEvents<any, any>>, data: any, cb: Callback) => void;
|
||||||
}
|
}
|
||||||
export default class Socket extends Duplex {
|
export default class Socket extends Duplex {
|
||||||
|
@ -14,7 +15,8 @@ export default class Socket extends Duplex {
|
||||||
bufferSize: any;
|
bufferSize: any;
|
||||||
readable: true;
|
readable: true;
|
||||||
writable: true;
|
writable: true;
|
||||||
constructor({ allowHalfOpen, remoteAddress, remotePort, write, }?: SocketOptions);
|
remotePublicKey: Uint8Array;
|
||||||
|
constructor({ allowHalfOpen, remoteAddress, remotePort, remotePublicKey, write, }?: SocketOptions);
|
||||||
private _connecting;
|
private _connecting;
|
||||||
get connecting(): boolean;
|
get connecting(): boolean;
|
||||||
get readyState(): string;
|
get readyState(): string;
|
||||||
|
|
|
@ -9,11 +9,13 @@ class Socket extends streamx_1.Duplex {
|
||||||
remotePort;
|
remotePort;
|
||||||
remoteFamily;
|
remoteFamily;
|
||||||
bufferSize;
|
bufferSize;
|
||||||
constructor({ allowHalfOpen = false, remoteAddress, remotePort, write, } = {}) {
|
remotePublicKey;
|
||||||
|
constructor({ allowHalfOpen = false, remoteAddress, remotePort, remotePublicKey, write, } = {}) {
|
||||||
super({ write });
|
super({ write });
|
||||||
this._allowHalfOpen = allowHalfOpen;
|
this._allowHalfOpen = allowHalfOpen;
|
||||||
this.remoteAddress = remoteAddress;
|
this.remoteAddress = remoteAddress;
|
||||||
this.remotePort = remotePort;
|
this.remotePort = remotePort;
|
||||||
|
this.remotePublicKey = remotePublicKey;
|
||||||
if (remoteAddress) {
|
if (remoteAddress) {
|
||||||
const type = Socket.isIP(remoteAddress);
|
const type = Socket.isIP(remoteAddress);
|
||||||
if (!type) {
|
if (!type) {
|
||||||
|
|
|
@ -9,6 +9,7 @@ interface SocketOptions {
|
||||||
allowHalfOpen?: boolean;
|
allowHalfOpen?: boolean;
|
||||||
remoteAddress?: string;
|
remoteAddress?: string;
|
||||||
remotePort?: number;
|
remotePort?: number;
|
||||||
|
remotePublicKey?: Uint8Array;
|
||||||
write?: (
|
write?: (
|
||||||
this: Duplex<any, any, any, any, true, true, DuplexEvents<any, any>>,
|
this: Duplex<any, any, any, any, true, true, DuplexEvents<any, any>>,
|
||||||
data: any,
|
data: any,
|
||||||
|
@ -26,17 +27,20 @@ export default class Socket extends Duplex {
|
||||||
|
|
||||||
declare readable: true;
|
declare readable: true;
|
||||||
declare writable: true;
|
declare writable: true;
|
||||||
|
public remotePublicKey: Uint8Array;
|
||||||
|
|
||||||
constructor({
|
constructor({
|
||||||
allowHalfOpen = false,
|
allowHalfOpen = false,
|
||||||
remoteAddress,
|
remoteAddress,
|
||||||
remotePort,
|
remotePort,
|
||||||
|
remotePublicKey,
|
||||||
write,
|
write,
|
||||||
}: SocketOptions = {}) {
|
}: SocketOptions = {}) {
|
||||||
super({ write });
|
super({ write });
|
||||||
this._allowHalfOpen = allowHalfOpen;
|
this._allowHalfOpen = allowHalfOpen;
|
||||||
this.remoteAddress = remoteAddress;
|
this.remoteAddress = remoteAddress;
|
||||||
this.remotePort = remotePort;
|
this.remotePort = remotePort;
|
||||||
|
this.remotePublicKey = remotePublicKey;
|
||||||
|
|
||||||
if (remoteAddress) {
|
if (remoteAddress) {
|
||||||
const type = Socket.isIP(remoteAddress);
|
const type = Socket.isIP(remoteAddress);
|
||||||
|
|
Loading…
Reference in New Issue