httpcloak 1.0.9 → 1.0.11
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/lib/index.d.ts +0 -31
- package/npm/darwin-arm64/package.json +1 -1
- package/npm/darwin-x64/package.json +1 -1
- package/npm/linux-arm64/package.json +1 -1
- package/npm/linux-x64/package.json +1 -1
- package/npm/win32-arm64/package.json +1 -1
- package/npm/win32-x64/package.json +1 -1
- package/package.json +7 -7
- package/test.js +0 -18
package/lib/index.d.ts
CHANGED
|
@@ -58,11 +58,6 @@ export interface RequestOptions {
|
|
|
58
58
|
timeout?: number;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
export type RequestCallback = (
|
|
62
|
-
error: HTTPCloakError | null,
|
|
63
|
-
response: Response | null
|
|
64
|
-
) => void;
|
|
65
|
-
|
|
66
61
|
export class Session {
|
|
67
62
|
constructor(options?: SessionOptions);
|
|
68
63
|
|
|
@@ -120,32 +115,6 @@ export class Session {
|
|
|
120
115
|
/** Perform an async OPTIONS request */
|
|
121
116
|
options(url: string, headers?: Record<string, string>): Promise<Response>;
|
|
122
117
|
|
|
123
|
-
// Callback-based methods
|
|
124
|
-
/** Perform a GET request with callback */
|
|
125
|
-
getCb(url: string, callback: RequestCallback): void;
|
|
126
|
-
getCb(
|
|
127
|
-
url: string,
|
|
128
|
-
headers: Record<string, string>,
|
|
129
|
-
callback: RequestCallback
|
|
130
|
-
): void;
|
|
131
|
-
|
|
132
|
-
/** Perform a POST request with callback */
|
|
133
|
-
postCb(url: string, callback: RequestCallback): void;
|
|
134
|
-
postCb(
|
|
135
|
-
url: string,
|
|
136
|
-
body: string | Buffer | Record<string, any>,
|
|
137
|
-
callback: RequestCallback
|
|
138
|
-
): void;
|
|
139
|
-
postCb(
|
|
140
|
-
url: string,
|
|
141
|
-
body: string | Buffer | Record<string, any>,
|
|
142
|
-
headers: Record<string, string>,
|
|
143
|
-
callback: RequestCallback
|
|
144
|
-
): void;
|
|
145
|
-
|
|
146
|
-
/** Perform a custom request with callback */
|
|
147
|
-
requestCb(options: RequestOptions, callback: RequestCallback): void;
|
|
148
|
-
|
|
149
118
|
// Cookie management
|
|
150
119
|
/** Get all cookies from the session */
|
|
151
120
|
getCookies(): Record<string, string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "httpcloak",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "Browser fingerprint emulation HTTP client with HTTP/1.1, HTTP/2, and HTTP/3 support",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"koffi": "^2.9.0"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"@httpcloak/linux-x64": "1.0.
|
|
39
|
-
"@httpcloak/linux-arm64": "1.0.
|
|
40
|
-
"@httpcloak/darwin-x64": "1.0.
|
|
41
|
-
"@httpcloak/darwin-arm64": "1.0.
|
|
42
|
-
"@httpcloak/win32-x64": "1.0.
|
|
43
|
-
"@httpcloak/win32-arm64": "1.0.
|
|
38
|
+
"@httpcloak/linux-x64": "1.0.11",
|
|
39
|
+
"@httpcloak/linux-arm64": "1.0.11",
|
|
40
|
+
"@httpcloak/darwin-x64": "1.0.11",
|
|
41
|
+
"@httpcloak/darwin-arm64": "1.0.11",
|
|
42
|
+
"@httpcloak/win32-x64": "1.0.11",
|
|
43
|
+
"@httpcloak/win32-arm64": "1.0.11"
|
|
44
44
|
}
|
|
45
45
|
}
|
package/test.js
CHANGED
|
@@ -37,24 +37,6 @@ async function main() {
|
|
|
37
37
|
console.log("Protocol:", asyncResponse.protocol);
|
|
38
38
|
console.log("");
|
|
39
39
|
|
|
40
|
-
// Test callback GET
|
|
41
|
-
console.log("--- Callback GET ---");
|
|
42
|
-
await new Promise((resolve, reject) => {
|
|
43
|
-
session.getCb(
|
|
44
|
-
"https://www.cloudflare.com/cdn-cgi/trace",
|
|
45
|
-
(err, response) => {
|
|
46
|
-
if (err) {
|
|
47
|
-
console.error("Error:", err.message);
|
|
48
|
-
reject(err);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
console.log("Status:", response.statusCode);
|
|
52
|
-
console.log("Protocol:", response.protocol);
|
|
53
|
-
resolve();
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
});
|
|
57
|
-
console.log("");
|
|
58
40
|
|
|
59
41
|
// Test concurrent requests
|
|
60
42
|
console.log("--- Concurrent Requests ---");
|