npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gemini-proxy-client

v1.0.22

Published

Gemini Proxy Build App 客户端 - 使用 Camoufox 自动保持连接

Downloads

2,448

Readme

Gemini Proxy Client

基于 Camoufox 的 Gemini Proxy 客户端工具,用于自动化连接和保活 Build App。

特性

  • 反指纹检测: 使用 Camoufox (基于 Firefox) 防止浏览器指纹识别
  • 随机指纹: 每个账号自动生成独立的浏览器指纹(分辨率、语言、时区)
  • 多账号支持: 可同时运行多个客户端连接不同 Google 账号
  • 自动登录管理: 首次需要手动登录,之后自动切换到无头模式
  • 自动连接: 自动点击 "Continue to the app" 和 "Connect WS" 按钮
  • 连接验证: 自动检测 WebSocket 连接是否成功
  • 自动保活: 每 2 小时检查登录状态,断线自动重连

快速开始

1. 安装

npm install -g gemini-proxy-client

2. 安装 Camoufox 浏览器

gemini-client setup

这会下载 Camoufox 浏览器(约 200MB)。如果网络有问题,可以设置代理:

export https_proxy=http://127.0.0.1:7890
gemini-client setup

3. 启动客户端

gemini-client start --server ws://your-server:5345/v1/ws

首次运行会:

  1. 打开浏览器窗口
  2. 等待您登录 Google 账号
  3. 登录成功后自动保存 cookies
  4. 关闭浏览器,以无头模式重新启动
  5. 自动连接到代理服务器

之后运行会直接以无头模式启动,无需再登录。

4. 后台运行

# 使用 nohup 后台运行
nohup gemini-client start -s ws://your-server:5345/v1/ws > gemini-client.log 2>&1 &

# 查看日志
tail -f gemini-client.log

# 停止
pkill -f gemini-client

多账号配置

可以在同一台机器上同时运行多个客户端,连接不同的 Google 账号:

# 账号 1 - 首次运行会弹出浏览器登录
nohup gemini-client start \
  --data-dir ~/.gemini-client/account1 \
  -s ws://your-server:5345/v1/ws \
  > account1.log 2>&1 &

# 账号 2 - 使用不同的 data-dir
nohup gemini-client start \
  --data-dir ~/.gemini-client/account2 \
  -s ws://your-server:5345/v1/ws \
  > account2.log 2>&1 &

# 账号 3
nohup gemini-client start \
  --data-dir ~/.gemini-client/account3 \
  -s ws://your-server:5345/v1/ws \
  > account3.log 2>&1 &

每个 --data-dir 会独立保存:

  • cookies.json - Google 登录状态
  • fingerprint.json - 浏览器指纹配置
  • config.json - 其他配置

随机指纹

每个账号首次启动时会自动生成随机的浏览器指纹:

| 项目 | 随机化范围 | |------|-----------| | 分辨率 | 1920x1080, 1366x768, 1440x900 等 10 种 | | 语言 | en-US, zh-CN, ja-JP 等 10 种 | | 时区 | America/New_York, Asia/Shanghai 等 10 种 |

指纹保存后会保持一致,避免同一账号频繁变化被检测。

命令参考

start - 启动客户端

gemini-client start [options]

| 选项 | 说明 | 默认值 | |------|------|--------| | -s, --server <url> | 代理服务器 WebSocket 地址 | ws://localhost:5345/v1/ws | | -t, --token <token> | 客户端认证令牌 | 自动生成 | | -d, --daemon | 后台运行模式 | false | | --headless | 强制无头模式 | 自动判断 | | --data-dir <path> | 数据目录路径 | ~/.gemini-client |

setup - 安装 Camoufox 浏览器

gemini-client setup

下载并安装 Camoufox 浏览器,首次使用前必须执行。

login - 登录 Google 账号

gemini-client login [--data-dir <path>]

单独执行登录操作,会打开浏览器让您登录 Google 账号。

logout - 清除登录状态

gemini-client logout [--data-dir <path>]

删除保存的 cookies,下次启动需要重新登录。

status - 查看状态

gemini-client status [--data-dir <path>]

查看当前登录状态和配置信息。

使用 PM2 管理(推荐)

使用 PM2 可以更方便地管理多个客户端:

# 安装 PM2
npm install -g pm2

# 启动多个账号
pm2 start "gemini-client start --data-dir ~/.gemini-client/account1 -s ws://server:5345/v1/ws" --name account1
pm2 start "gemini-client start --data-dir ~/.gemini-client/account2 -s ws://server:5345/v1/ws" --name account2
pm2 start "gemini-client start --data-dir ~/.gemini-client/account3 -s ws://server:5345/v1/ws" --name account3

# 查看状态
pm2 status

# 查看日志
pm2 logs

# 停止所有
pm2 stop all

# 开机自启
pm2 startup
pm2 save

无图形界面服务器

如果是纯命令行服务器(无桌面环境),需要安装虚拟显示:

# Ubuntu/Debian
sudo apt-get install xvfb

# 使用 xvfb-run 运行(首次登录时需要)
xvfb-run gemini-client start --data-dir ~/.gemini-client/account1 -s ws://server:5345/v1/ws

注意:首次登录需要在有图形界面的环境中完成(或使用 VNC/远程桌面)。

工作流程

首次启动
    ↓
打开浏览器 UI → 用户登录 Google
    ↓
保存 cookies 和 fingerprint
    ↓
关闭浏览器 → 以无头模式重新启动
    ↓
自动点击 "Continue to the app"
    ↓
自动点击 "Connect WS" 按钮
    ↓
验证连接成功 → 后台运行
    ↓
定期检查登录状态(每 2 小时)

保活机制

  • 登录状态检查: 每 2 小时检查一次 Google 登录状态
  • 连接状态检查: 每 30 秒检查一次页面是否正常
  • 自动重连: 连接断开时自动尝试重新连接
  • 登录过期处理: 登录过期时会弹出浏览器让用户重新登录

系统要求

  • Node.js >= 18.0.0
  • 能够访问 GitHub(下载 Camoufox 浏览器)
  • 能够访问 Google AI Studio
  • 图形界面或 Xvfb(首次登录需要)

常见问题

Q: Camoufox 下载失败怎么办?

设置代理后重试:

export https_proxy=http://127.0.0.1:7890
npx camoufox-js fetch

Q: Google 登录状态能保持多久?

通常 1-2 周,但可能因 IP 变化、长时间无活动或 Google 安全检测而提前失效。

Q: 多账号会被检测到吗?

Camoufox + 随机指纹可以降低检测风险,但同一 IP 运行过多账号仍有风险。建议:

  • 同一 IP 不超过 2-3 个账号
  • 使用代理让不同账号走不同 IP(效果更好)

Q: 如何确认连接成功?

查看日志,成功连接会显示:

✅ 点击了 "Continue to the app" 按钮
✅ 点击了连接按钮
  检测按钮文字: "Disconnect WS"
✅ WebSocket 连接成功!
✅ 客户端已启动 (无头模式)

License

MIT