summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/socks/typings
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/socks/typings')
-rw-r--r--deps/npm/node_modules/socks/typings/client/socksclient.d.ts44
-rw-r--r--deps/npm/node_modules/socks/typings/common/constants.d.ts15
-rw-r--r--deps/npm/node_modules/socks/typings/common/receiveBuffer.d.ts2
3 files changed, 32 insertions, 29 deletions
diff --git a/deps/npm/node_modules/socks/typings/client/socksclient.d.ts b/deps/npm/node_modules/socks/typings/client/socksclient.d.ts
index 33e1c25fc5..bd0b6ff4d2 100644
--- a/deps/npm/node_modules/socks/typings/client/socksclient.d.ts
+++ b/deps/npm/node_modules/socks/typings/client/socksclient.d.ts
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
import { SocksClientOptions, SocksClientChainOptions, SocksRemoteHost, SocksProxy, SocksClientBoundEvent, SocksClientEstablishedEvent, SocksUDPFrameDetails } from '../common/constants';
import { SocksClientError } from '../common/util';
import { Duplex } from 'stream';
-interface SocksClient {
+declare interface SocksClient {
on(event: 'error', listener: (err: SocksClientError) => void): this;
on(event: 'bound', listener: (info: SocksClientBoundEvent) => void): this;
on(event: 'established', listener: (info: SocksClientEstablishedEvent) => void): this;
@@ -59,99 +59,101 @@ declare class SocksClient extends EventEmitter implements SocksClient {
/**
* Gets the SocksClient internal state.
*/
+ private get state();
/**
* Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state.
*/
- private state;
+ private set state(value);
/**
* Starts the connection establishment to the proxy and destination.
* @param existing_socket Connected socket to use instead of creating a new one (internal use).
*/
connect(existing_socket?: Duplex): void;
+ private getSocketOptions;
/**
* Handles internal Socks timeout callback.
* Note: If the Socks client is not BoundWaitingForConnection or Established, the connection will be closed.
*/
- private onEstablishedTimeout();
+ private onEstablishedTimeout;
/**
* Handles Socket connect event.
*/
- private onConnect();
+ private onConnect;
/**
* Handles Socket data event.
* @param data
*/
- private onDataReceived(data);
+ private onDataReceived;
/**
* Handles processing of the data we have received.
*/
- private processData();
+ private processData;
/**
* Handles Socket close event.
* @param had_error
*/
- private onClose();
+ private onClose;
/**
* Handles Socket error event.
* @param err
*/
- private onError(err);
+ private onError;
/**
* Removes internal event listeners on the underlying Socket.
*/
- private removeInternalSocketHandlers();
+ private removeInternalSocketHandlers;
/**
* Closes and destroys the underlying Socket. Emits an error event.
* @param err { String } An error string to include in error event.
*/
- private _closeSocket(err);
+ private _closeSocket;
/**
* Sends initial Socks v4 handshake request.
*/
- private sendSocks4InitialHandshake();
+ private sendSocks4InitialHandshake;
/**
* Handles Socks v4 handshake response.
* @param data
*/
- private handleSocks4FinalHandshakeResponse();
+ private handleSocks4FinalHandshakeResponse;
/**
* Handles Socks v4 incoming connection request (BIND)
* @param data
*/
- private handleSocks4IncomingConnectionResponse();
+ private handleSocks4IncomingConnectionResponse;
/**
* Sends initial Socks v5 handshake request.
*/
- private sendSocks5InitialHandshake();
+ private sendSocks5InitialHandshake;
/**
* Handles initial Socks v5 handshake response.
* @param data
*/
- private handleInitialSocks5HandshakeResponse();
+ private handleInitialSocks5HandshakeResponse;
/**
* Sends Socks v5 user & password auth handshake.
*
* Note: No auth and user/pass are currently supported.
*/
- private sendSocks5UserPassAuthentication();
+ private sendSocks5UserPassAuthentication;
/**
* Handles Socks v5 auth handshake response.
* @param data
*/
- private handleInitialSocks5AuthenticationHandshakeResponse();
+ private handleInitialSocks5AuthenticationHandshakeResponse;
/**
* Sends Socks v5 final handshake request.
*/
- private sendSocks5CommandRequest();
+ private sendSocks5CommandRequest;
/**
* Handles Socks v5 final handshake response.
* @param data
*/
- private handleSocks5FinalHandshakeResponse();
+ private handleSocks5FinalHandshakeResponse;
/**
* Handles Socks v5 incoming connection request (BIND).
*/
- private handleSocks5IncomingConnectionResponse();
- readonly socksClientOptions: SocksClientOptions;
+ private handleSocks5IncomingConnectionResponse;
+ get socksClientOptions(): SocksClientOptions;
}
export { SocksClient, SocksClientOptions, SocksClientChainOptions, SocksRemoteHost, SocksProxy, SocksUDPFrameDetails };
diff --git a/deps/npm/node_modules/socks/typings/common/constants.d.ts b/deps/npm/node_modules/socks/typings/common/constants.d.ts
index c8870be623..546fe3cfd9 100644
--- a/deps/npm/node_modules/socks/typings/common/constants.d.ts
+++ b/deps/npm/node_modules/socks/typings/common/constants.d.ts
@@ -1,6 +1,6 @@
/// <reference types="node" />
import { Duplex } from 'stream';
-import { Socket } from 'net';
+import { Socket, SocketConnectOpts } from 'net';
import { RequireOnlyOne } from './util';
declare const DEFAULT_TIMEOUT = 30000;
declare type SocksProxyType = 4 | 5;
@@ -44,18 +44,18 @@ declare type SocksCommandOption = 'connect' | 'bind' | 'associate';
declare enum SocksCommand {
connect = 1,
bind = 2,
- associate = 3,
+ associate = 3
}
declare enum Socks4Response {
Granted = 90,
Failed = 91,
Rejected = 92,
- RejectedIdent = 93,
+ RejectedIdent = 93
}
declare enum Socks5Auth {
NoAuth = 0,
GSSApi = 1,
- UserPass = 2,
+ UserPass = 2
}
declare enum Socks5Response {
Granted = 0,
@@ -66,12 +66,12 @@ declare enum Socks5Response {
ConnectionRefused = 5,
TTLExpired = 6,
CommandNotSupported = 7,
- AddressNotSupported = 8,
+ AddressNotSupported = 8
}
declare enum Socks5HostType {
IPv4 = 1,
Hostname = 3,
- IPv6 = 4,
+ IPv6 = 4
}
declare enum SocksClientState {
Created = 0,
@@ -86,7 +86,7 @@ declare enum SocksClientState {
BoundWaitingForConnection = 9,
Established = 10,
Disconnected = 11,
- Error = 99,
+ Error = 99
}
/**
* Represents a SocksProxy
@@ -116,6 +116,7 @@ interface SocksClientOptions {
timeout?: number;
existing_socket?: Duplex;
set_tcp_nodelay?: boolean;
+ socket_options?: SocketConnectOpts;
}
/**
* SocksClient chain connection options.
diff --git a/deps/npm/node_modules/socks/typings/common/receiveBuffer.d.ts b/deps/npm/node_modules/socks/typings/common/receiveBuffer.d.ts
index fe506a0357..7af56db121 100644
--- a/deps/npm/node_modules/socks/typings/common/receiveBuffer.d.ts
+++ b/deps/npm/node_modules/socks/typings/common/receiveBuffer.d.ts
@@ -4,7 +4,7 @@ declare class ReceiveBuffer {
private _offset;
private _originalSize;
constructor(size?: number);
- readonly length: number;
+ get length(): number;
append(data: Buffer): number;
peek(length: number): Buffer;
get(length: number): Buffer;