Windows / DEPLOYMENT
Windows 手动部署
在 Windows 10 / 11 或 Windows Server 上手动运行 QQNT、QQNT Bridge 与 CrossGram Server,适合本机试用和桌面常驻。
准备:安装 64 位 Node.js 24+、Git for Windows 和 Corepack,并确保 PowerShell 可以执行本地命令。生产部署建议优先选择 Linux。
1. 克隆并安装 Server
git clone https://github.com/std-microblock/crossgram.git
cd crossgram
corepack enable
yarn install
yarn build 开发调试可运行 yarn dev;构建后运行 yarn start。首次启动会在 data/rsa-key.json 和对应 PEM 文件中生成 RSA 密钥。
2. 安装 QQNT 与 QQNT Bridge
- 安装并登录 Windows QQNT,关闭自动更新或确认 QQNT Bridge 支持当前版本。
- 从
crossgram-project/qqnt-bridge的 Releases 下载 Windows 构建,按其 README 完成注入或启动。 - 确认 Bridge API 可在默认地址
http://127.0.0.1:18767/v1访问,并记录 bearer token。 - 在启动 CrossGram 的终端设置
QQNT_BRIDGE_TOKEN,或在本地配置中显式填写 token。
3. 配置监听地址
编辑 app.yml 中 MTProto 插件的 host、port 与 QQNT endpoint。局域网使用时,把 host 配成这台电脑的 LAN 地址并允许 Windows 防火墙放行 TCP 4430。
- id: mtproto01
name: '@mtproto-relay/mtproto'
config:
port: 4430
host: 0.0.0.0
rsaKeyPath: ./data/rsa-key.json
- id: qqnt
name: '@mtproto-relay/platform-qqnt'
config:
endpoint: http://127.0.0.1:18767/v1 4. 准备并登录客户端
推荐直接从下载页使用带服务器导入能力的 CrossGram 客户端。若使用 Telegram Desktop 分支,也可以运行仓库中的二进制补丁脚本:
node binary_patch/patch-tdesktop.cjs --host 192.168.1.10 \
--port 4430 "C:\Path\To\Telegram.exe" 打开 http://127.0.0.1:3140/platform-accounts,使用页面上的虚拟手机号与六位登录码完成登录。