browsermob-proxy-api-client 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/typings/proxy.d.ts +221 -0
- package/dist/typings/proxy.js +3 -0
- package/dist/typings/proxy.js.map +1 -0
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const http_1 = __importDefault(require("http"));
|
|
2
7
|
var Method;
|
|
3
8
|
(function (Method) {
|
|
4
9
|
Method["GET"] = "GET";
|
|
@@ -6,14 +11,14 @@ var Method;
|
|
|
6
11
|
Method["PUT"] = "PUT";
|
|
7
12
|
Method["DELETE"] = "DELETE";
|
|
8
13
|
})(Method || (Method = {}));
|
|
9
|
-
|
|
14
|
+
class BrowserMobProxyAPIClient {
|
|
10
15
|
constructor(host = 'localhost', port = 8080) {
|
|
11
16
|
this.host = host;
|
|
12
17
|
this.port = port;
|
|
13
18
|
}
|
|
14
19
|
httpRequest(options, payload = '') {
|
|
15
20
|
return new Promise((resolve, reject) => {
|
|
16
|
-
const req =
|
|
21
|
+
const req = http_1.default.request({
|
|
17
22
|
host: this.host,
|
|
18
23
|
port: this.port,
|
|
19
24
|
...options,
|
|
@@ -243,4 +248,5 @@ export default class BrowserMobProxyAPIClient {
|
|
|
243
248
|
}, interceptor);
|
|
244
249
|
}
|
|
245
250
|
}
|
|
251
|
+
exports.default = BrowserMobProxyAPIClient;
|
|
246
252
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;AAAA,gDAA4C;AAkB5C,IAAK,MAKJ;AALD,WAAK,MAAM;IACT,qBAAW,CAAA;IACX,uBAAa,CAAA;IACb,qBAAW,CAAA;IACX,2BAAiB,CAAA;AACnB,CAAC,EALI,MAAM,KAAN,MAAM,QAKV;AAED,MAAqB,wBAAwB;IAK3C,YAAY,IAAI,GAAG,WAAW,EAAE,IAAI,GAAG,IAAI;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAES,WAAW,CACnB,OAAuB,EACvB,OAAO,GAAG,EAAE;QAEZ,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,GAAG,GAAG,cAAI,CAAC,OAAO,CACtB;gBACE,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,GAAG,OAAO;aACX,EACD,GAAG,CAAC,EAAE;gBACJ,MAAM,IAAI,GAAa,EAAE,CAAC;gBAC1B,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC1C,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;oBACjB,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;gBACvB,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEL,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAExC,IAAI,OAAO,EAAE;gBACX,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;aACpB;YAED,GAA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pB;YACE,IAAI,EAAE,UAAU,IAAI,kBAAkB;YACtC,MAAM,EAAE,MAAM,CAAC,IAAI;YACnB,OAAO,EAAE;gBACP,cAAc,EAAE,YAAY;aAC7B;SACF,EACD,WAAW,CACZ,CAAC;IACJ,CAAC;CACF;AAlTD,2CAkTC"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
export interface ProxyListItem {
|
|
2
|
+
port: number;
|
|
3
|
+
}
|
|
4
|
+
export interface ProxyList {
|
|
5
|
+
proxyList: ProxyListItem[];
|
|
6
|
+
}
|
|
7
|
+
export interface StartProxyArgs {
|
|
8
|
+
/**
|
|
9
|
+
* The specific port to start the proxy service on.
|
|
10
|
+
* Optional, default is generated and returned in response.
|
|
11
|
+
*/
|
|
12
|
+
port?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The username to use to authenticate with the chained proxy.
|
|
15
|
+
* Optional, default to null.
|
|
16
|
+
*/
|
|
17
|
+
proxyUsername?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The password to use to authenticate with the chained proxy.
|
|
20
|
+
* Optional, default to null.
|
|
21
|
+
*/
|
|
22
|
+
proxyPassword?: string;
|
|
23
|
+
/**
|
|
24
|
+
* If running BrowserMob Proxy in a multi-homed environment,
|
|
25
|
+
* specify a desired bind address. Optional, default to "0.0.0.0".
|
|
26
|
+
*/
|
|
27
|
+
bindAddress?: string;
|
|
28
|
+
/**
|
|
29
|
+
* If running BrowserMob Proxy in a multi-homed environment,
|
|
30
|
+
* specify a desired server bind address. Optional, default to "0.0.0.0".
|
|
31
|
+
*/
|
|
32
|
+
serverBindAddress?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Uses Elliptic Curve Cryptography for certificate impersonation.
|
|
35
|
+
* Optional, default to "false".
|
|
36
|
+
*/
|
|
37
|
+
useEcc?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Disables verification of all upstream servers' SSL certificates.
|
|
40
|
+
* All upstream servers will be trusted,
|
|
41
|
+
* even if they do not present valid certificates
|
|
42
|
+
* signed by certification authorities in the JDK's trust store.
|
|
43
|
+
* Optional, default to "false".
|
|
44
|
+
*/
|
|
45
|
+
trustAllServers?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface StartHarArgs {
|
|
48
|
+
/**
|
|
49
|
+
* capture headers or not
|
|
50
|
+
* Optional, default to "false".
|
|
51
|
+
*/
|
|
52
|
+
captureHeaders?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* capture cookies or not
|
|
55
|
+
* Optional, default to "false"
|
|
56
|
+
*/
|
|
57
|
+
captureCookies?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* capture content bodies or not
|
|
60
|
+
* Optional, default to "false"
|
|
61
|
+
*/
|
|
62
|
+
captureContent?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* capture binary content or not
|
|
65
|
+
* Optional, default to "false"
|
|
66
|
+
*/
|
|
67
|
+
captureBinaryContent?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The string name of The first page ref that should be used in the HAR.
|
|
70
|
+
* Optional, default to "Page 1".
|
|
71
|
+
*/
|
|
72
|
+
initialPageRef?: string;
|
|
73
|
+
/**
|
|
74
|
+
* The title of first HAR page. Optional, default to initialPageRef.
|
|
75
|
+
*/
|
|
76
|
+
initialPageTitle?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface NewHarPageArgs {
|
|
79
|
+
/**
|
|
80
|
+
* The string name of the first page ref that should be used in the HAR.
|
|
81
|
+
* Optional, default to "Page N" where N is the next page number.
|
|
82
|
+
*/
|
|
83
|
+
pageRef?: string;
|
|
84
|
+
/**
|
|
85
|
+
* The title of new HAR page.
|
|
86
|
+
* Optional, default to pageRef.
|
|
87
|
+
*/
|
|
88
|
+
pageTitle?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface SetWhitelistArgs {
|
|
91
|
+
/**
|
|
92
|
+
* A comma separated list of regular expressions
|
|
93
|
+
*/
|
|
94
|
+
regex: string;
|
|
95
|
+
/**
|
|
96
|
+
* The HTTP status code to return for URLs that do not match the whitelist.
|
|
97
|
+
* Optional, default to 200
|
|
98
|
+
*/
|
|
99
|
+
status?: number;
|
|
100
|
+
}
|
|
101
|
+
export interface SetBlacklistArgs {
|
|
102
|
+
/**
|
|
103
|
+
* The blacklist regular expression
|
|
104
|
+
*/
|
|
105
|
+
regex: string;
|
|
106
|
+
/**
|
|
107
|
+
* The HTTP status code to return for URLs that are blacklisted
|
|
108
|
+
*/
|
|
109
|
+
status?: number;
|
|
110
|
+
/**
|
|
111
|
+
* The regular expression for matching HTTP method (GET, POST, PUT, etc).
|
|
112
|
+
* Optional, by default processing all HTTP method.
|
|
113
|
+
*/
|
|
114
|
+
method?: string;
|
|
115
|
+
}
|
|
116
|
+
export interface BlacklistItem {
|
|
117
|
+
urlPattern: string;
|
|
118
|
+
statusCode: number;
|
|
119
|
+
httpMethodPattern: string | null;
|
|
120
|
+
responseCode: number;
|
|
121
|
+
pattern: string;
|
|
122
|
+
method: string | null;
|
|
123
|
+
}
|
|
124
|
+
export interface SetBandwidthLimitArgs {
|
|
125
|
+
/**
|
|
126
|
+
* Sets the downstream bandwidth limit in kbps
|
|
127
|
+
*/
|
|
128
|
+
downstreamKbps?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Sets the upstream bandwidth limit kbps
|
|
131
|
+
* by default unlimited
|
|
132
|
+
*/
|
|
133
|
+
upstreamKbps?: number;
|
|
134
|
+
/**
|
|
135
|
+
* Specifies how many kilobytes in total the client is allowed to download through the proxy
|
|
136
|
+
* by default unlimited
|
|
137
|
+
*/
|
|
138
|
+
downstreamMaxKB?: number;
|
|
139
|
+
/**
|
|
140
|
+
* Specifies how many kilobytes in total the client is allowed to upload through the proxy
|
|
141
|
+
* by default unlimited
|
|
142
|
+
*/
|
|
143
|
+
upstreamMaxKB?: number;
|
|
144
|
+
/**
|
|
145
|
+
* Add the given latency to each HTTP request
|
|
146
|
+
* by default all requests are invoked without latency
|
|
147
|
+
*/
|
|
148
|
+
latency?: number;
|
|
149
|
+
/**
|
|
150
|
+
* A boolean that enable bandwidth limiter.
|
|
151
|
+
* by default to "false", but setting any of the properties above will implicitly enable throttling
|
|
152
|
+
*/
|
|
153
|
+
enable?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Specifying what percentage of data sent is payload, e.g. use this to take into account overhead due to tcp/ip
|
|
156
|
+
*/
|
|
157
|
+
payloadPercentage?: number;
|
|
158
|
+
/**
|
|
159
|
+
* The max bits per seconds you want this instance of StreamManager to respect
|
|
160
|
+
*/
|
|
161
|
+
maxBitsPerSecond?: number;
|
|
162
|
+
}
|
|
163
|
+
export interface BandwidthLimitsResponse {
|
|
164
|
+
maxUpstreamKB: number;
|
|
165
|
+
remainingUpstreamKB: number;
|
|
166
|
+
maxDownstreamKB: number;
|
|
167
|
+
remainingDownstreamKB: number;
|
|
168
|
+
}
|
|
169
|
+
export interface SetRewriteArgs {
|
|
170
|
+
/**
|
|
171
|
+
* A matching URL regular expression
|
|
172
|
+
*/
|
|
173
|
+
matchRegex: string;
|
|
174
|
+
/**
|
|
175
|
+
* replacement URL
|
|
176
|
+
*/
|
|
177
|
+
replace: string;
|
|
178
|
+
}
|
|
179
|
+
export interface SetRetryCountArgs {
|
|
180
|
+
/**
|
|
181
|
+
* The number of times a method will be retried.
|
|
182
|
+
*/
|
|
183
|
+
retrycount: number;
|
|
184
|
+
}
|
|
185
|
+
export interface WaitArgs {
|
|
186
|
+
/**
|
|
187
|
+
* Wait till all request are being made
|
|
188
|
+
*/
|
|
189
|
+
quietPeriodInMs: number;
|
|
190
|
+
/**
|
|
191
|
+
* Sets quiet period in milliseconds
|
|
192
|
+
*/
|
|
193
|
+
timeoutInMs: number;
|
|
194
|
+
}
|
|
195
|
+
export interface SetTimeoutsArgs {
|
|
196
|
+
/**
|
|
197
|
+
* Request timeout in milliseconds.
|
|
198
|
+
* A timeout value of -1 is interpreted as infinite timeout.
|
|
199
|
+
* default to "-1".
|
|
200
|
+
*/
|
|
201
|
+
requestTimeout?: number;
|
|
202
|
+
/**
|
|
203
|
+
* Read timeout in milliseconds. Which is the timeout for waiting for data or,
|
|
204
|
+
* put differently, a maximum period inactivity between two consecutive data packets.
|
|
205
|
+
* A timeout value of zero is interpreted as an infinite timeout.
|
|
206
|
+
* default to "60000".
|
|
207
|
+
*/
|
|
208
|
+
readTimeout?: number;
|
|
209
|
+
/**
|
|
210
|
+
* Determines the timeout in milliseconds until a connection is established.
|
|
211
|
+
* A timeout value of zero is interpreted as an infinite timeout.
|
|
212
|
+
* default to "60000".
|
|
213
|
+
*/
|
|
214
|
+
connectionTimeout?: number;
|
|
215
|
+
/**
|
|
216
|
+
* Sets the maximum length of time that records will be stored in this Cache.
|
|
217
|
+
* A nonpositive value disables this feature (that is, sets no limit).
|
|
218
|
+
* default to "0".
|
|
219
|
+
*/
|
|
220
|
+
dnsCacheTimeout?: number;
|
|
221
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../typings/proxy.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browsermob-proxy-api-client",
|
|
3
|
-
"version": "0.0.4",
|
|
4
3
|
"main": "dist/index.js",
|
|
5
4
|
"types": "dist/index.d.ts",
|
|
6
5
|
"license": "MIT",
|
|
@@ -8,6 +7,9 @@
|
|
|
8
7
|
"build": "tsc",
|
|
9
8
|
"eslint": "eslint --cache --ext .ts ."
|
|
10
9
|
},
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=16"
|
|
12
|
+
},
|
|
11
13
|
"homepage": "https://github.com/raul72/browsermob-proxy-api-client/",
|
|
12
14
|
"repository": {
|
|
13
15
|
"type": "git",
|
|
@@ -18,6 +20,7 @@
|
|
|
18
20
|
},
|
|
19
21
|
"devDependencies": {
|
|
20
22
|
"@microsoft/eslint-formatter-sarif": "2.1.7",
|
|
23
|
+
"@tsconfig/node16": "^1.0.3",
|
|
21
24
|
"@types/node": "^16",
|
|
22
25
|
"@typescript-eslint/eslint-plugin": "^5.46.0",
|
|
23
26
|
"@typescript-eslint/parser": "^5.46.0",
|
|
@@ -25,5 +28,6 @@
|
|
|
25
28
|
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
26
29
|
"eslint-plugin-import": "^2.26.0",
|
|
27
30
|
"typescript": "^4.9.4"
|
|
28
|
-
}
|
|
31
|
+
},
|
|
32
|
+
"version": "0.0.6"
|
|
29
33
|
}
|