@simonyea/holysheep-cli 1.7.110 → 1.7.112
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.112",
|
|
4
4
|
"description": "Claude Code/Cursor/Cline API relay for China — ¥1=$1, WeChat/Alipay payment, no credit card, no VPN. One command setup for all AI coding tools.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openai-china",
|
|
@@ -197,31 +197,14 @@ function createConnectTunnel(proxyUrl, target, headers) {
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
function pipeWithCleanup(a, b) {
|
|
200
|
-
// TCP keepalive
|
|
200
|
+
// TCP keepalive 检测真正的网络断开(不用 stall timer,会误杀 extended thinking)
|
|
201
201
|
for (const sock of [a, b]) {
|
|
202
|
-
if (typeof sock.setKeepAlive === 'function') sock.setKeepAlive(true,
|
|
202
|
+
if (typeof sock.setKeepAlive === 'function') sock.setKeepAlive(true, 10000)
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
// 智能 stall 检测:有数据在流突然停了 → 15秒判死
|
|
206
|
-
// 空闲隧道等新请求 → 不超时
|
|
207
|
-
let lastActivity = Date.now()
|
|
208
|
-
let hasData = false
|
|
209
|
-
const onData = () => { lastActivity = Date.now(); hasData = true }
|
|
210
|
-
a.on('data', onData)
|
|
211
|
-
b.on('data', onData)
|
|
212
|
-
|
|
213
|
-
const stallCheck = setInterval(() => {
|
|
214
|
-
if (hasData && Date.now() - lastActivity > 15000) {
|
|
215
|
-
clearInterval(stallCheck)
|
|
216
|
-
a.destroy(new Error('stream stalled'))
|
|
217
|
-
b.destroy(new Error('stream stalled'))
|
|
218
|
-
}
|
|
219
|
-
}, 5000)
|
|
220
|
-
|
|
221
205
|
a.pipe(b)
|
|
222
206
|
b.pipe(a)
|
|
223
207
|
const close = () => {
|
|
224
|
-
clearInterval(stallCheck)
|
|
225
208
|
a.destroy()
|
|
226
209
|
b.destroy()
|
|
227
210
|
}
|