-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathconstants.js
94 lines (93 loc) · 3.05 KB
/
constants.js
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
module.exports = {
DEFAULT_OPTIONS: {
upstream: false,
tcpOutgoingAddress: false,
verbose: false,
injectData: false,
injectResponse: false,
auth: false,
intercept: false,
keys: false,
handleSni: false,
logger: undefined,
interceptOptions: {
server: {
rejectUnauthorized: false,
requestCert: false
},
client: {
rejectUnauthorized: false,
requestCert: false
}
}
},
EVENTS: {
CLOSE: 'close',
DATA: 'data',
ERROR: 'error',
EXIT: 'exit',
},
ERROR_CODES: {
ETIMEDOUT: 'ETIMEDOUT',
ENOTFOUND: 'ENOTFOUND',
EPIPE: 'EPIPE',
EPROTO: 'EPROTO'
},
HTTP: 'http',
HTTPS: 'https',
HTTP_PORT: 80,
HTTPS_PORT: 443,
HTTP_BODIES: {
AUTH_REQUIRED: 'Proxy Authorization Required!',
NOT_FOUND: 'Not Found!'
},
HTTP_RESPONSES: {
OK: 'HTTP/1.0 200 OK',
NOT_FOUND: 'HTTP/1.0 404 Not Found',
NOT_OK: 'HTTP/1.0 400 Bad Request',
AUTH_REQUIRED: 'HTTP/1.0 407 Proxy Authorization Required' + '\r\nProxy-Authenticate: Basic realm=""',
TIMED_OUT: 'HTTP/1.0 408 Request Timeout'
},
HTTP_METHODS: {
CONNECT: 'CONNECT',
GET: 'GET',
},
STRINGS: {
AT: '@',
BLANK: ' ',
BINARY_ENCODING: 'binary',
CHUNKED: 'chunked',
CONTENT_LENGTH: 'content-length',
CRLF: '\r\n',
EMPTY: '',
LF: '\n',
SEPARATOR: ':',
PROXY_AUTH: 'Proxy-Authorization',
TRANSFER_ENCODING: 'transfer-encoding',
PROXY_AUTH_BASIC: 'Basic',
PLACEHOLDER_PROTOCOL: 'undefined:',
ZERO: '0'
},
SLASH: '/',
SLASH_REGEXP: /\//gmi,
SLASH_REGEXP_ONCE: /\//g,
PROTOCOL_REGEXP: /^https?:\/\//i,
DEFAULT_KEYS: {
key: '-----BEGIN PRIVATE KEY-----\n' +
'MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgFy3kvv0iHTVaeqcv\n' +
'DIzScropX09AFbieQAy8Dyh8kCihRANCAAQ+UBhyBUy/izj5jozMz+aLpzj7/lPS\n' +
'jAQbWM+8aSDYmu7Ermo6+qz9PatGixPE1c3cq0E9BSqOEVYMXiVcizeQ\n' +
'-----END PRIVATE KEY-----',
cert: '-----BEGIN CERTIFICATE-----\n' +
'MIIBlTCCATygAwIBAgIUcUDMIG9bw3nWnUS5vwGPIgX3zIcwCgYIKoZIzj0EAwIw\n' +
'FDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIwMDEyMjIzMjIwN1oXDTIxMDEyMTIz\n' +
'MjIwN1owFDESMBAGA1UEAwwJbG9jYWxob3N0MFkwEwYHKoZIzj0CAQYIKoZIzj0D\n' +
'AQcDQgAEPlAYcgVMv4s4+Y6MzM/mi6c4+/5T0owEG1jPvGkg2JruxK5qOvqs/T2r\n' +
'RosTxNXN3KtBPQUqjhFWDF4lXIs3kKNsMGowaAYDVR0RBGEwX4IJbG9jYWxob3N0\n' +
'ggsqLmxvY2FsaG9zdIIVbG9jYWxob3N0LmxvY2FsZG9tYWluhwR/AAABhwQAAAAA\n' +
'hxAAAAAAAAAAAAAAAAAAAAABhxAAAAAAAAAAAAAAAAAAAAAAMAoGCCqGSM49BAMC\n' +
'A0cAMEQCIH/3IPGNTbCQnr1F1x0r28BtwkhMZPLRSlm7p0uXDv9pAiBi4JQKEwlY\n' +
'6sWzsJyD3vMMAyP9UZm0WJhtcOb6F0wRpg==\n' +
'-----END CERTIFICATE-----'
}
};