koonjs 0.5.5 → 0.6.0

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/index.d.ts CHANGED
@@ -28,7 +28,7 @@ export interface KoonOptions {
28
28
  proxy?: string;
29
29
  /** Array of proxy URLs for round-robin rotation. Takes priority over `proxy`. */
30
30
  proxies?: string[];
31
- /** Request timeout in milliseconds. Default: 30000. */
31
+ /** Request timeout in seconds. Default: 30. */
32
32
  timeout?: number;
33
33
  /** Skip TLS certificate verification. */
34
34
  ignoreTlsErrors?: boolean;
@@ -44,7 +44,7 @@ export interface KoonOptions {
44
44
  randomize?: boolean;
45
45
  /** Enable TLS session resumption. Default: true. */
46
46
  sessionResumption?: boolean;
47
- /** DNS-over-HTTPS provider ("cloudflare", "google", or URL). */
47
+ /** DNS-over-HTTPS provider. Supported values: "cloudflare", "google". */
48
48
  doh?: string;
49
49
  /** Bind outgoing connections to a specific local IP address. */
50
50
  localAddress?: string;
@@ -87,8 +87,10 @@ export class KoonResponse {
87
87
  readonly connectionReused: boolean;
88
88
  /** Remote IP address of the peer (e.g. "1.2.3.4" or "::1"), or null for H3/QUIC. */
89
89
  readonly remoteAddress: string | null;
90
+ /** Content-Type header value (e.g. "text/html; charset=utf-8"), or null if absent. */
91
+ readonly contentType: string | null;
90
92
 
91
- /** Decode response body as UTF-8 string. */
93
+ /** Decode response body as text, respecting the charset from the Content-Type header. Falls back to UTF-8. */
92
94
  text(): string;
93
95
  /** Parse response body as JSON (via JSON.parse()). */
94
96
  json(): any;
@@ -106,7 +108,7 @@ export interface KoonWsMessage {
106
108
  export interface KoonRequestOptions {
107
109
  /** Additional headers for this request. Override constructor-level headers. */
108
110
  headers?: Record<string, string>;
109
- /** Per-request timeout in milliseconds. Overrides constructor-level timeout. */
111
+ /** Per-request timeout in seconds. Overrides constructor-level timeout. */
110
112
  timeout?: number;
111
113
  }
112
114
 
@@ -190,11 +192,11 @@ export interface KoonProxyOptions {
190
192
  profileJson?: string;
191
193
  /** Listen address. Default: "127.0.0.1:0". */
192
194
  listenAddr?: string;
193
- /** Header mode: "forward", "replace", or "merge". */
195
+ /** Header mode: "impersonate" (default) or "passthrough". */
194
196
  headerMode?: string;
195
197
  /** CA certificate directory. */
196
198
  caDir?: string;
197
- /** Request timeout in milliseconds. Default: 30000. */
199
+ /** Request timeout in seconds. Default: 30. */
198
200
  timeout?: number;
199
201
  /** Apply fingerprint randomization. */
200
202
  randomize?: boolean;
Binary file
Binary file
package/package.json CHANGED
@@ -1,10 +1,18 @@
1
1
  {
2
2
  "name": "koonjs",
3
- "version": "0.5.5",
3
+ "version": "0.6.0",
4
4
  "description": "Browser-impersonating HTTP client with TLS/HTTP2 fingerprint spoofing",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "license": "MIT",
8
+ "author": "scrape-hub",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/scrape-hub/koon.git",
12
+ "directory": "crates/node"
13
+ },
14
+ "homepage": "https://github.com/scrape-hub/koon",
15
+ "bugs": "https://github.com/scrape-hub/koon/issues",
8
16
  "engines": {
9
17
  "node": ">= 16"
10
18
  },