File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ const dispatcher = socksDispatcher({
4646 port: 1081 ,
4747 // userId: "foo",
4848 // password: "bar",
49- }],
49+ }],
5050 // set some TLS options
5151 connect: {
5252 rejectUnauthorized: false ,
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import TLSOptions = buildConnector.BuildOptions;
55
66type onEstablished = Parameters < typeof SocksClient . createConnection > [ 1 ] ;
77
8+ type Proxies = SocksProxy | SocksProxy [ ] ;
9+
810/**
911 * Since socks does not guess HTTP ports, we need to do that.
1012 *
@@ -21,7 +23,7 @@ function resolvePort(protocol: string, port: string) {
2123 * @param proxies The proxy server to use or the list of proxy servers to chain.
2224 * @param tlsOpts TLS upgrade options.
2325 */
24- export function socksConnector ( proxies : SocksProxy | SocksProxy [ ] , tlsOpts : TLSOptions = { } ) : Connector {
26+ export function socksConnector ( proxies : Proxies , tlsOpts : TLSOptions = { } ) : Connector {
2527 const { timeout = 10e3 } = tlsOpts ;
2628 const tlsUpgrade = buildConnector ( tlsOpts ) ;
2729
@@ -64,7 +66,7 @@ export interface SocksDispatcherOptions extends Agent.Options {
6466 /**
6567 * The socks proxy server to use or the list of proxy servers to chain.
6668 */
67- proxy : SocksProxy | SocksProxy [ ] ;
69+ proxy : Proxies ;
6870
6971 /**
7072 * TLS upgrade options, see:
You can’t perform that action at this time.
0 commit comments