@ossiana/node-libcurl 1.9.4 → 1.9.5

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.
Files changed (2) hide show
  1. package/package.json +6 -6
  2. package/readme.md +43 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ossiana/node-libcurl",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "author": {
5
5
  "name": "Ossian"
6
6
  },
@@ -25,11 +25,11 @@
25
25
  "typescript": "^4.9.4"
26
26
  },
27
27
  "optionalDependencies": {
28
- "@ossiana/node-libcurl-darwin-arm64": "1.9.4",
29
- "@ossiana/node-libcurl-darwin-x64": "1.9.4",
30
- "@ossiana/node-libcurl-linux-arm64-gnu": "1.9.4",
31
- "@ossiana/node-libcurl-linux-x64-gnu": "1.9.4",
32
- "@ossiana/node-libcurl-win32-x64-msvc": "1.9.4"
28
+ "@ossiana/node-libcurl-darwin-arm64": "1.9.5",
29
+ "@ossiana/node-libcurl-darwin-x64": "1.9.5",
30
+ "@ossiana/node-libcurl-linux-arm64-gnu": "1.9.5",
31
+ "@ossiana/node-libcurl-linux-x64-gnu": "1.9.5",
32
+ "@ossiana/node-libcurl-win32-x64-msvc": "1.9.5"
33
33
  },
34
34
  "main": "./dist/index.js",
35
35
  "files": [
package/readme.md CHANGED
@@ -135,7 +135,7 @@ const retrySession = session.retry(3, (resp, error) => {
135
135
  | `data` | `string \| Uint8Array \| URLSearchParams \| object` | Sends a body. Objects are form-encoded (`a=1&b=2`), and `Content-Type` is set automatically. Cannot be combined with `json`. |
136
136
  | `timeout` | `number` | Timeout in seconds. |
137
137
  | `redirect` | `boolean` | Follow redirects (default `false`). |
138
- | `proxy` | `string \| { proxy, username, password }` | Proxy, e.g. `"http://127.0.0.1:8888"`, `"socks5://user:pass@host:1080"`, or an account object. |
138
+ | `proxy` | `string \| { proxy, username, password }` | Proxy, e.g. `"http://127.0.0.1:8888"`, `"socks5://user:pass@host:1080"`, or an account object. For HTTP/3 use a SOCKS5 proxy with UDP relay — see [HTTP/3 through a SOCKS5 UDP proxy](#http3-through-a-socks5-udp-proxy). |
139
139
  | `httpVersion` | `"http1.1" \| "http2" \| "http3" \| "http3_only"` | HTTP protocol version. |
140
140
  | `interface` | `string` | Bind to a specific network interface. |
141
141
  | `ja3` | see [Fingerprints](#3-fingerprints) | TLS (JA3) fingerprint. |
@@ -149,6 +149,46 @@ const retrySession = session.retry(3, (resp, error) => {
149
149
  | `sslCert` | `{ certBlob, privateKeyBlob?, type?, password? }` | Client certificate (`type`: `"PEM" \| "DER" \| "P12"`). |
150
150
  | `sslVerify` | `{ caPath: string }` | Custom CA bundle path. |
151
151
 
152
+ #### HTTP/3 through a SOCKS5 UDP proxy
153
+
154
+ HTTP/3 runs over QUIC, which uses **UDP** instead of TCP — so a regular HTTP/HTTPS proxy (which relays TCP) cannot carry it. To proxy HTTP/3, use a **SOCKS5 proxy that supports UDP relay** (SOCKS5 UDP ASSOCIATE, RFC 1928 §7). When an HTTP/3 request is paired with a `socks5://` proxy, the client automatically negotiates a UDP relay with the proxy and tunnels QUIC through it — no special scheme or extra option is needed:
155
+
156
+ ```ts
157
+ const session = requests.session({
158
+ httpVersion: "http3_only", // or "http3"
159
+ proxy: "socks5://user:pass@host:port", // a socks5 proxy with UDP relay
160
+ http3Fingerprint: "auto", // QUIC fingerprint still applies
161
+ });
162
+
163
+ const resp = await session.get("https://fp.impersonate.pro/api/http3");
164
+ console.log(resp.json.protocol); // "http3"
165
+ ```
166
+
167
+ The proxy object form and `setProxy` work too:
168
+
169
+ ```ts
170
+ session.setProxy({
171
+ proxy: "socks5://host:port",
172
+ username: "user",
173
+ password: "pass",
174
+ });
175
+ ```
176
+
177
+ Same for `fetch`:
178
+
179
+ ```ts
180
+ await fetch("https://example.com", {
181
+ httpVersion: "http3_only",
182
+ proxy: "socks5://user:pass@host:port",
183
+ });
184
+ ```
185
+
186
+ Behavior notes:
187
+
188
+ * `http3_only` fails hard (throws `Couldn't connect to server`) if the proxy has no working UDP relay.
189
+ * `http3` falls back to TCP (HTTP/1.1/2 through the proxy) when the UDP relay fails — the response will not be HTTP/3.
190
+ * Very few proxy vendors support SOCKS5 UDP relay (most are HTTP/HTTPS-only or SOCKS5-TCP-only; those that support UDP typically ship it as a beta feature) — confirm with your provider before relying on it.
191
+
152
192
  #### Response
153
193
 
154
194
  | Property | Type | Description |
@@ -236,6 +276,8 @@ http3Fingerprint: { // fully custom config
236
276
  },
237
277
  ```
238
278
 
279
+ > Proxied HTTP/3 needs a SOCKS5 proxy with UDP relay — see [HTTP/3 through a SOCKS5 UDP proxy](#http3-through-a-socks5-udp-proxy).
280
+
239
281
  #### TLS signature algorithms (HTTP/1.1 HTTP/2)
240
282
 
241
283
  ```ts