15815213711
2024-08-26 67b8b6731811983447e053d4396b3708c14dfe3c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// @flow
 
import {
  Socket,
} from 'net';
import {
  TLSSocket,
} from 'tls';
import {
  Agent as HttpAgent,
} from 'http';
import {
  Agent as HttpsAgent,
} from 'https';
 
export type ProxyConfigurationType = {|
  +authorization: string,
  +hostname: string,
  +port: number,
|};
 
export type TlsConfigurationType = {|
  +ca?: string,
  +cert?: string,
  +ciphers?: string,
  +clientCertEngine?: string,
  +crl?: string,
  +dhparam?: string,
  +ecdhCurve?: string,
  +honorCipherOrder?: boolean,
  +key?: string,
  +passphrase?: string,
  +pfx?: string,
  +rejectUnauthorized?: boolean,
  +secureOptions?: number,
  +secureProtocol?: string,
  +servername?: string,
  +sessionIdContext?: string,
|};
 
export type ConnectionConfigurationType = {|
  +host: string,
  +port: number,
  +tls?: TlsConfigurationType,
  +proxy: ProxyConfigurationType,
|};
 
export type ConnectionCallbackType = (error: Error | null, socket?: Socket | TLSSocket) => void;
 
export type AgentType = HttpAgent | HttpsAgent;
export type IsProxyConfiguredMethodType = () => boolean;
export type MustUrlUseProxyMethodType = (url: string) => boolean;
export type GetUrlProxyMethodType = (url: string) => ProxyConfigurationType;
export type ProtocolType = 'http:' | 'https:';
 
export type ProxyAgentConfigurationInputType = {|
  +environmentVariableNamespace?: string,
  +forceGlobalAgent?: boolean,
  +socketConnectionTimeout?: number,
|};
 
export type ProxyAgentConfigurationType = {|
  +environmentVariableNamespace: string,
  +forceGlobalAgent: boolean,
  +socketConnectionTimeout: number,
|};