Skip to content

Commit ee2b5e1

Browse files
committed
polish
1 parent 1df49c7 commit ee2b5e1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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,

index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import TLSOptions = buildConnector.BuildOptions;
55

66
type 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:

0 commit comments

Comments
 (0)