- 一个端口按路径分发:/cnchess /cngo /cs 进程型,/alonelyroad /myword 静态目录 - 进程型首次访问以动态端口拉起子进程,就绪探测后转发;空闲 600s 且无 WS 连接才回收 - WebSocket 走原始 TCP 隧道(握手转发 + 101 透传 + 双向对拷,任一方向 EOF 即拆连) - 文本响应就地重写根绝对路径(href/src/fetch/url(/ 与 location.host}/ws),游戏源码零改动 - 入口页只显示状态与进入入口,不提供管理按钮;网关/运维接口为 /api/* - 配置 games.json 磁盘优先、内嵌兜底,改完刷新即生效
67 lines
1.8 KiB
JSON
67 lines
1.8 KiB
JSON
{
|
|
"port": 1818,
|
|
"idle_secs": 600,
|
|
"games": [
|
|
{
|
|
"id": "cnchess",
|
|
"name": "中国象棋",
|
|
"tagline": "两台设备联机对弈,服务端权威判棋",
|
|
"icon": "象",
|
|
"accent": "#e2523f",
|
|
"stack": "Rust · axum",
|
|
"meta": ["2 人 · 观战", "WebSocket", "内置语音"],
|
|
"kind": "process",
|
|
"cwd": "../cnchess",
|
|
"bin": "target/release/cnchess"
|
|
},
|
|
{
|
|
"id": "cngo",
|
|
"name": "围棋",
|
|
"tagline": "落子圈地,联机对局、观战与棋谱",
|
|
"icon": "围",
|
|
"accent": "#4aa8ff",
|
|
"stack": "Rust · axum",
|
|
"meta": ["2 人 · 观战", "WebSocket", "贴目规则"],
|
|
"kind": "process",
|
|
"cwd": "../cngo",
|
|
"bin": "target/release/cngo"
|
|
},
|
|
{
|
|
"id": "cs",
|
|
"name": "枪火对决",
|
|
"tagline": "第一人称 1v1 对枪,60Hz 物理模拟",
|
|
"icon": "枪",
|
|
"accent": "#f5a623",
|
|
"stack": "Rust · WebGL",
|
|
"meta": ["1v1 对战", "WebSocket", "30Hz 快照"],
|
|
"kind": "process",
|
|
"cwd": "../cs",
|
|
"bin": "target/release/cs"
|
|
},
|
|
{
|
|
"id": "alonelyroad",
|
|
"name": "沙漠狂飙",
|
|
"tagline": "单机越野冲刺,纯 Canvas 手写渲染",
|
|
"icon": "飙",
|
|
"accent": "#ffb84d",
|
|
"stack": "单页 · Canvas",
|
|
"meta": ["单人", "键盘 / 触屏", "零依赖"],
|
|
"kind": "static",
|
|
"dir": "../AlonelyRoad",
|
|
"entry": "AlonelyRoad.html"
|
|
},
|
|
{
|
|
"id": "myword",
|
|
"name": "我的世界",
|
|
"tagline": "体素沙盒:挖矿、合成、生存,夜里僵尸会来",
|
|
"icon": "世",
|
|
"accent": "#55c98a",
|
|
"stack": "单页 · Three.js",
|
|
"meta": ["单人", "合成 / 生存", "CDN 依赖"],
|
|
"kind": "static",
|
|
"dir": "../MyWord",
|
|
"entry": "index.html"
|
|
}
|
|
]
|
|
}
|