支持私人联机的在线扑克平台,目前支持德州扑克。
npm install
npm start浏览器打开 http://localhost:3000,多个标签页即可联机对战。
- 输入昵称,点击 创建房间,获得 4 位房间码
- 好友输入房间码 加入房间,房主可配置游戏参数
- 全部准备 → 房主点击 开始游戏
- 按提示操作:弃牌 / 过牌 / 跟注 / 加注 / All-in
- 一局结束后点击 下一局 继续
# 安装 cloudflared
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o cloudflared
chmod +x cloudflared
# 启动游戏
npm start
# 另一个终端创建公网隧道
./cloudflared tunnel --url http://localhost:3000输出 https://xxx.trycloudflare.com 分享给好友即可。
# 服务器上
git clone <repo> && cd poker
npm install
npm start
# 安全组放行 3000 端口访问 http://<服务器IP>:3000。
在 server/config.js 中可通过环境变量 PORT 自定义端口:
PORT=8080 npm start房主在房间大厅可展开设置面板:
| 设置 | 说明 | 默认 |
|---|---|---|
| 回合时间 | 超时自动弃牌 | 30s |
| 小盲 / 大盲 | 盲注金额 | 10 / 20 |
| 初始筹码 | 每人起始筹码 | 1000 |
| Run It Twice | all-in 后发两次公共牌 | 关 |
| 补筹码 | 允许买入及范围 | 200-2000 |
npm start # 启动服务器
npm run dev # 开发模式(自动重启)
npm test # 运行所有测试
npm run test:cards # 仅卡牌测试
npm run test:texas # 仅德州引擎测试Node.js + Express + Socket.IO,纯 HTML/CSS/JS 前端,无需数据库。