docs: document CPX distribution options

This commit is contained in:
ezequielnick
2026-07-10 11:01:46 +08:00
parent 726d12c74c
commit 304085f225
2 changed files with 22 additions and 0 deletions

View File

@@ -137,6 +137,17 @@ Generator:
node scripts/plugin/gen-cpx.mjs <loginUrl> <providerName> [site] [output]
```
### Distribution Options
- **File download**: Distribute the `.cpx` file directly. Clients with the file association registered can launch the app by double-clicking the file and will see the plugin preview and confirmation page.
- **Deep link**: Host the same `.cpx` file at a public HTTPS URL, then use the following link in a web button or QR code:
```text
clash://install-plugin?url=https%3A%2F%2Fprovider.example.com%2Fapp.cpx
```
`mihomo://` is equivalent to `clash://`. URL-encode the `url` parameter. The client downloads and validates the file, installs the plugin, and opens the system browser for login. The download URL must use public HTTPS, redirects are rejected, and the file must not exceed 1 MiB.
---
## 4. OAuth Authorize

View File

@@ -124,6 +124,17 @@ v2 不再把真实订阅 URL 或 API 域名写入客户端文件。用户导入
node scripts/plugin/gen-cpx.mjs <loginUrl> <providerName> [site] [output]
```
### 分发方式
- **文件分发**:直接提供 `.cpx` 下载。已注册文件关联的客户端支持双击 `.cpx` 启动应用,并打开插件预览确认页。
- **Deep link**:将同一份 `.cpx` 托管在公网 HTTPS 地址,再把以下链接用于网页按钮或二维码:
```text
clash://install-plugin?url=https%3A%2F%2Fprovider.example.com%2Fapp.cpx
```
`mihomo://` 与 `clash://` 等价。`url` 参数应进行 URL 编码;客户端下载并校验文件后会安装插件并打开系统浏览器登录。下载地址必须使用公网 HTTPS、不允许重定向文件大小不超过 1 MiB。
---
## 4. OAuth authorize