Skip to content

Commit ba59915

Browse files
committed
1 parent f9984e6 commit ba59915

File tree

8 files changed

+381
-274
lines changed

8 files changed

+381
-274
lines changed

node_modules/socks-proxy-agent/dist/agent.d.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

node_modules/socks-proxy-agent/dist/agent.js

Lines changed: 0 additions & 181 deletions
This file was deleted.

node_modules/socks-proxy-agent/dist/agent.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
/// <reference types="node" />
2-
import { Url } from 'url';
32
import { SocksProxy } from 'socks';
4-
import tls from 'tls';
3+
import { Agent, ClientRequest, RequestOptions } from 'agent-base';
54
import { AgentOptions } from 'agent-base';
6-
import _SocksProxyAgent from './agent';
7-
declare function createSocksProxyAgent(opts: string | createSocksProxyAgent.SocksProxyAgentOptions): _SocksProxyAgent;
8-
declare namespace createSocksProxyAgent {
9-
interface BaseSocksProxyAgentOptions {
10-
host?: string | null;
11-
port?: string | number | null;
12-
username?: string | null;
13-
tls?: tls.ConnectionOptions | null;
14-
}
15-
export interface SocksProxyAgentOptions extends AgentOptions, BaseSocksProxyAgentOptions, Partial<Omit<Url & SocksProxy, keyof BaseSocksProxyAgentOptions>> {
16-
}
17-
export type SocksProxyAgent = _SocksProxyAgent;
18-
export const SocksProxyAgent: typeof _SocksProxyAgent;
19-
export {};
5+
import { Url } from 'url';
6+
import net from 'net';
7+
import tls from 'tls';
8+
interface BaseSocksProxyAgentOptions {
9+
host?: string | null;
10+
port?: string | number | null;
11+
username?: string | null;
12+
tls?: tls.ConnectionOptions | null;
13+
}
14+
interface SocksProxyAgentOptionsExtra {
15+
timeout?: number;
16+
}
17+
export interface SocksProxyAgentOptions extends AgentOptions, BaseSocksProxyAgentOptions, Partial<Omit<Url & SocksProxy, keyof BaseSocksProxyAgentOptions>> {
18+
}
19+
export declare class SocksProxyAgent extends Agent {
20+
private readonly shouldLookup;
21+
private readonly proxy;
22+
private readonly tlsConnectionOptions;
23+
timeout: number | null;
24+
constructor(input: string | SocksProxyAgentOptions, options?: SocksProxyAgentOptionsExtra);
25+
/**
26+
* Initiates a SOCKS connection to the specified SOCKS proxy server,
27+
* which in turn connects to the specified remote host and port.
28+
*
29+
* @api protected
30+
*/
31+
callback(req: ClientRequest, opts: RequestOptions): Promise<net.Socket>;
2032
}
21-
export = createSocksProxyAgent;
33+
export {};

0 commit comments

Comments
 (0)