把 配置文件 mdpc-config.yaml.default 的结构改为
listen: 127.0.0.1
port: 18080
log: ""
xray:
files-dir: bin/xray/
core-start: “bin/xray/xray run -confdir bin/xray/”
core-test: “bin/xray/xray run -confdir bin/xray/ -test”
core1:
files-dir: ""
core-start: ""
core-test: ""
相应的, API 改为
文件操作 — /api/*/files
GET /api/xray/files
GET /api/xray/files/{filename}
PUT /api/xray/files/{filename}
DELETE /api/xray/files/{filename}
进程操作 — /api/*/core
GET /api/xray/core/status
POST /api/xray/core/start
POST /api/xray/core/stop
POST /api/xray/core/test
注意 mdpc-config.yaml.default 里面是可以包含多个 翻墙内核结构的,
对于示例来说, 有一个 core1 的结构, 那么API 应该对应地有:
文件操作 — /api/*/files
GET /api/core1/files
GET /api/core1/files/{filename}
PUT /api/core1/files/{filename}
DELETE /api/core1/files/{filename}
进程操作 — /api/*/core
GET /api/core1/core/status
POST /api/core1/core/start
POST /api/core1/core/stop
POST /api/core1/core/test
给 mdpc-config.yaml.default 配置文件 添加 hy2 和 sing-box 结构
要求 翻墙内核 只能同时运行1个.
如果某个内核正在运行, 前端调用api core/start 那么应该先停止当前运行的内核, 再启动新内核