rust-http-playback-proxy 0.7.0 → 0.7.1
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/README.md
CHANGED
|
@@ -67,6 +67,8 @@ async function playback() {
|
|
|
67
67
|
const proxy = await startPlayback({
|
|
68
68
|
port: 8080,
|
|
69
69
|
inventoryDir: './inventory',
|
|
70
|
+
fullThrottle: false, // Set true to disable timing control (TTFB and transfer speed)
|
|
71
|
+
passthrough: true, // Forward unmatched requests to real servers instead of 404
|
|
70
72
|
});
|
|
71
73
|
|
|
72
74
|
console.log(`Playback proxy started on port ${proxy.port}`);
|
|
@@ -129,8 +131,10 @@ interface RecordingOptions {
|
|
|
129
131
|
#### `PlaybackOptions`
|
|
130
132
|
```typescript
|
|
131
133
|
interface PlaybackOptions {
|
|
132
|
-
port?: number;
|
|
133
|
-
inventoryDir?: string;
|
|
134
|
+
port?: number; // Optional: Port to listen on (default: 8080, will auto-search)
|
|
135
|
+
inventoryDir?: string; // Optional: Directory containing inventory (default: './inventory')
|
|
136
|
+
fullThrottle?: boolean; // Optional: Disable timing control (TTFB and transfer speed) for fastest playback
|
|
137
|
+
passthrough?: boolean; // Optional: Forward unmatched requests to real servers instead of 404
|
|
134
138
|
}
|
|
135
139
|
```
|
|
136
140
|
|
|
@@ -153,7 +157,7 @@ interface Resource {
|
|
|
153
157
|
statusCode?: number;
|
|
154
158
|
errorMessage?: string;
|
|
155
159
|
rawHeaders?: Record<string, string>;
|
|
156
|
-
contentEncoding?: ContentEncodingType;
|
|
160
|
+
contentEncoding?: ContentEncodingType; // 'gzip' | 'compress' | 'deflate' | 'br' | 'zstd' | 'identity'
|
|
157
161
|
contentTypeMime?: string;
|
|
158
162
|
contentCharset?: string;
|
|
159
163
|
contentFilePath?: string;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type DeviceType = 'desktop' | 'mobile';
|
|
|
5
5
|
/**
|
|
6
6
|
* Content encoding type
|
|
7
7
|
*/
|
|
8
|
-
export type ContentEncodingType = 'gzip' | 'compress' | 'deflate' | 'br' | 'identity';
|
|
8
|
+
export type ContentEncodingType = 'gzip' | 'compress' | 'deflate' | 'br' | 'zstd' | 'identity';
|
|
9
9
|
/**
|
|
10
10
|
* HTTP headers map
|
|
11
11
|
*/
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,IAAI,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC;AAE/F;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rust-http-playback-proxy",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "HTTP traffic recording and playback proxy with precise timing control for PageSpeed optimization and performance testing",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|