- antigravity/node-tls-proxy/ ← 原 tools/node-tls-proxy - antigravity/firewall/ ← 原 tools/firewall - antigravity/maintenance/ ← 原 tools/maintenance - repository/http_upstream_antigravity.go ← Node.js 代理 3 个方法(原在 http_upstream.go) - service/identity_service_antigravity.go ← ApplyDefaultFingerprintOverrides + NewIdentityServiceWithSalt - service/account_antigravity.go ← Gemini TLS 指纹扩展函数 对上游文件 http_upstream.go 的钩子调用精简为 2 处 if 块(共 14 行) 对上游文件 account.go Gemini 分支精简为 1 行函数调用 便于 upstream rebase 时快速识别和保留自定义改动
25 lines
836 B
Docker
25 lines
836 B
Docker
FROM node:24.13.0-slim
|
|
|
|
LABEL maintainer="Wei-Shaw <github.com/Wei-Shaw>"
|
|
LABEL description="Node.js TLS Forward Proxy - native JA3/JA4 fingerprint matching"
|
|
LABEL org.opencontainers.image.source="https://github.com/Wei-Shaw/sub2api"
|
|
|
|
WORKDIR /app
|
|
|
|
COPY proxy.js package.json ./
|
|
|
|
# 零依赖,不需要 npm install
|
|
|
|
ENV PROXY_PORT=3456
|
|
ENV PROXY_HOST=0.0.0.0
|
|
ENV UPSTREAM_HOST=api.anthropic.com
|
|
|
|
EXPOSE 3456
|
|
|
|
# 健康检查:用 Node.js 内置 http 模块,不依赖 curl
|
|
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=5s \
|
|
CMD node -e "const http=require('http');const r=http.get('http://127.0.0.1:'+(process.env.PROXY_PORT||3456)+'/__health',s=>{process.exit(s.statusCode===200?0:1)});r.on('error',()=>process.exit(1));r.setTimeout(3000,()=>{r.destroy();process.exit(1)})"
|
|
|
|
USER node
|
|
CMD ["node", "proxy.js"]
|