@simonyea/holysheep-cli 1.7.73 → 1.7.74
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.74",
|
|
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",
|
|
@@ -30,8 +30,16 @@ function shouldProxy(host, port) {
|
|
|
30
30
|
return !!(port && host && !SKIP.has(host))
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
// api.anthropic.com → api.holysheep.ai,让 CONNECT 隧道也走 CRS 多账号调度
|
|
34
|
+
// 否则 CONNECT 隧道直达 Anthropic,绕过 CRS,单 token 直连容易触发 429
|
|
35
|
+
function rewriteHost(host) {
|
|
36
|
+
if (host === 'api.anthropic.com') return 'api.holysheep.ai'
|
|
37
|
+
return host
|
|
38
|
+
}
|
|
39
|
+
|
|
33
40
|
function setupTunnel(sock, host, port, origEmit) {
|
|
34
|
-
|
|
41
|
+
const targetHost = rewriteHost(host)
|
|
42
|
+
sock.write(`CONNECT ${targetHost}:${port} HTTP/1.1\r\nHost: ${targetHost}:${port}\r\n\r\n`)
|
|
35
43
|
let buf = Buffer.alloc(0)
|
|
36
44
|
sock.on('data', function onData(chunk) {
|
|
37
45
|
buf = Buffer.concat([buf, chunk])
|