libhyperproxy/dist/socket.d.ts

38 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-01-12 17:50:38 +00:00
import { Duplex, DuplexEvents, Callback } from "streamx";
type AddressFamily = "IPv6" | "IPv4";
interface SocketOptions {
allowHalfOpen?: boolean;
remoteAddress?: string;
remotePort?: number;
2023-02-25 01:04:45 +00:00
remotePublicKey?: Uint8Array;
2023-01-12 17:50:38 +00:00
write?: (this: Duplex<any, any, any, any, true, true, DuplexEvents<any, any>>, data: any, cb: Callback) => void;
}
export default class Socket extends Duplex {
private _allowHalfOpen;
remoteAddress: any;
remotePort: any;
remoteFamily: AddressFamily;
bufferSize: any;
2023-02-06 15:52:26 +00:00
readable: true;
writable: true;
2023-02-25 01:04:45 +00:00
remotePublicKey: Uint8Array;
constructor({ allowHalfOpen, remoteAddress, remotePort, remotePublicKey, write, }?: SocketOptions);
2023-01-12 17:50:38 +00:00
private _connecting;
get connecting(): boolean;
get readyState(): string;
listen(): void;
setTimeout(msecs: any, callback: any): void;
_onTimeout(): void;
setNoDelay(enable: boolean): void;
setKeepAlive(setting: any, msecs: number): void;
address(): {
address: any;
port: any;
family: AddressFamily;
};
static isIP(input: string): number;
static isIPv4(input: string): boolean;
static isIPv6(input: string): boolean;
}
export {};