@tiktool/live 2.4.9 → 2.5.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
@@ -1,5 +1,3 @@
1
- <div align="center">
2
-
3
1
  # @tiktool/live
4
2
 
5
3
  ### Connect to any TikTok LIVE stream in 4 lines of code.
@@ -13,8 +11,6 @@ Real-time chat, gifts, viewers, battles, follows & 18+ event types from any TikT
13
11
 
14
12
  [Quick Start](#-quick-start) · [Events](#-events) · [API](#-api-reference) · [Rate Limits](#-rate-limits) · [Get API Key](https://tik.tools)
15
13
 
16
- </div>
17
-
18
14
  ---
19
15
 
20
16
  ## ⚡ Quick Start
@@ -58,7 +54,7 @@ await live.connect();
58
54
  with our server YOUR IP
59
55
  ```
60
56
 
61
- - Your app connects directly to TikTok from your IP address
57
+ - Your app connects directly to TikTok from your IP or through a proxy
62
58
  - The sign server only generates cryptographic signatures (requires API key)
63
59
  - TikTok never sees the sign server
64
60
  - Built-in protobuf parser, no external dependencies
@@ -123,6 +119,7 @@ live.on('event', (event) => {
123
119
  | `uniqueId` | `string` | — | TikTok username (without @) |
124
120
  | `apiKey` | `string` | — | **Required.** API key from [tik.tools](https://tik.tools) |
125
121
  | `signServerUrl` | `string` | `https://api.tik.tools` | Sign server URL |
122
+ | `proxyUrl` | `string` | — | HTTP proxy for all connections (`http://user:pass@host:port`) |
126
123
  | `autoReconnect` | `boolean` | `true` | Auto-reconnect on disconnect |
127
124
  | `maxReconnectAttempts` | `number` | `5` | Max reconnect attempts |
128
125
  | `heartbeatInterval` | `number` | `10000` | Heartbeat interval (ms) |
@@ -257,6 +254,29 @@ console.log('Forwarding events to ws://localhost:8080');
257
254
 
258
255
  ---
259
256
 
257
+ ## 🌐 Proxy Support
258
+
259
+ Route all connections through an HTTP proxy. Works with any HTTPS proxy provider (residential, datacenter, etc.).
260
+
261
+ ```typescript
262
+ import { TikTokLive } from '@tiktool/live';
263
+
264
+ const live = new TikTokLive({
265
+ uniqueId: 'streamer_name',
266
+ apiKey: 'YOUR_API_KEY',
267
+ proxyUrl: 'http://user:pass@proxy.example.com:1234',
268
+ });
269
+
270
+ await live.connect(); // Both HTTP and WebSocket go through the proxy
271
+ ```
272
+
273
+ Both the initial page request and the WebSocket connection are routed through the proxy. This is useful for:
274
+ - Running multiple concurrent connections from different IPs
275
+ - Avoiding rate limits
276
+ - Geo-targeting specific regions
277
+
278
+ ---
279
+
260
280
  ## TypeScript
261
281
 
262
282
  Full TypeScript support with type inference: