@tiktool/live 2.4.9 → 2.5.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/README.md CHANGED
@@ -58,7 +58,7 @@ await live.connect();
58
58
  with our server YOUR IP
59
59
  ```
60
60
 
61
- - Your app connects directly to TikTok from your IP address
61
+ - Your app connects directly to TikTok from your IP or through a proxy
62
62
  - The sign server only generates cryptographic signatures (requires API key)
63
63
  - TikTok never sees the sign server
64
64
  - Built-in protobuf parser, no external dependencies
@@ -123,6 +123,7 @@ live.on('event', (event) => {
123
123
  | `uniqueId` | `string` | — | TikTok username (without @) |
124
124
  | `apiKey` | `string` | — | **Required.** API key from [tik.tools](https://tik.tools) |
125
125
  | `signServerUrl` | `string` | `https://api.tik.tools` | Sign server URL |
126
+ | `proxyUrl` | `string` | — | HTTP proxy for all connections (`http://user:pass@host:port`) |
126
127
  | `autoReconnect` | `boolean` | `true` | Auto-reconnect on disconnect |
127
128
  | `maxReconnectAttempts` | `number` | `5` | Max reconnect attempts |
128
129
  | `heartbeatInterval` | `number` | `10000` | Heartbeat interval (ms) |
@@ -257,6 +258,29 @@ console.log('Forwarding events to ws://localhost:8080');
257
258
 
258
259
  ---
259
260
 
261
+ ## 🌐 Proxy Support
262
+
263
+ Route all connections through an HTTP proxy. Works with any HTTPS proxy provider (residential, datacenter, etc.).
264
+
265
+ ```typescript
266
+ import { TikTokLive } from '@tiktool/live';
267
+
268
+ const live = new TikTokLive({
269
+ uniqueId: 'streamer_name',
270
+ apiKey: 'YOUR_API_KEY',
271
+ proxyUrl: 'http://user:pass@proxy.example.com:1234',
272
+ });
273
+
274
+ await live.connect(); // Both HTTP and WebSocket go through the proxy
275
+ ```
276
+
277
+ Both the initial page request and the WebSocket connection are routed through the proxy. This is useful for:
278
+ - Running multiple concurrent connections from different IPs
279
+ - Avoiding rate limits
280
+ - Geo-targeting specific regions
281
+
282
+ ---
283
+
260
284
  ## TypeScript
261
285
 
262
286
  Full TypeScript support with type inference: