@simonyea/holysheep-cli 1.7.110 → 1.7.111
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.111",
|
|
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,27 @@ function createConnectTunnel(proxyUrl, target, headers) {
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
function pipeWithCleanup(a, b) {
|
|
200
|
-
// TCP keepalive: 15秒探测
|
|
201
200
|
for (const sock of [a, b]) {
|
|
202
|
-
if (typeof sock.setKeepAlive === 'function') sock.setKeepAlive(true,
|
|
201
|
+
if (typeof sock.setKeepAlive === 'function') sock.setKeepAlive(true, 10000)
|
|
203
202
|
}
|
|
204
203
|
|
|
205
|
-
//
|
|
206
|
-
//
|
|
207
|
-
let
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
b.on('data', onData)
|
|
212
|
-
|
|
213
|
-
const stallCheck = setInterval(() => {
|
|
214
|
-
if (hasData && Date.now() - lastActivity > 15000) {
|
|
215
|
-
clearInterval(stallCheck)
|
|
204
|
+
// 精确 stall 检测:每次收到数据重置 5 秒倒计时
|
|
205
|
+
// 数据停了恰好 5 秒就断开,Claude Code 立即发起新请求
|
|
206
|
+
let stallTimer = null
|
|
207
|
+
const touchStall = () => {
|
|
208
|
+
if (stallTimer) clearTimeout(stallTimer)
|
|
209
|
+
stallTimer = setTimeout(() => {
|
|
216
210
|
a.destroy(new Error('stream stalled'))
|
|
217
211
|
b.destroy(new Error('stream stalled'))
|
|
218
|
-
}
|
|
219
|
-
}
|
|
212
|
+
}, 5000)
|
|
213
|
+
}
|
|
214
|
+
a.on('data', touchStall)
|
|
215
|
+
b.on('data', touchStall)
|
|
220
216
|
|
|
221
217
|
a.pipe(b)
|
|
222
218
|
b.pipe(a)
|
|
223
219
|
const close = () => {
|
|
224
|
-
|
|
220
|
+
if (stallTimer) clearTimeout(stallTimer)
|
|
225
221
|
a.destroy()
|
|
226
222
|
b.destroy()
|
|
227
223
|
}
|