Path: API › Proxy 反向代理

`POST /mod/proxy/com/{action}/stype`

管理反向代理站点的域名绑定。

## Path parameters

- `action` (`action213.path.action`; string, required) — 具体操作名称，参见下方原始接口文档。

## Request body

_Required._

- `request_time` (`action213.request_time`; string, required) — Unix 时间戳。
- `request_token` (`action213.request_token`; string, required) — 按 API 概览生成的签名。
- `id` (`action213.id`; integer, required) — 站点 ID
- `site_name` (`action213.site_name`; string, required) — 站点名称
- `domains` (`action213.domains`; string, required) — 域名，多个用换行符分隔，可带端口 `domain:8080`

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "id": 0,
  "site_name": "string",
  "domains": "string"
}
```

## Code samples

### cURL（填写面板地址与签名）

```bash
curl --request POST \
  --url "https://your-panel.example.com:8888/mod/proxy/com/<action>/stype" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "request_time=<Unix时间戳>" \
  --data-urlencode "request_token=<按 API 概览生成的签名>" \
  --data-urlencode "id=<id>" \
  --data-urlencode "site_name=<site_name>" \
  --data-urlencode "domains=<domains>"
```

## Responses

### default

接口响应，业务状态见下方详细说明。

#### Example

```json
{
  "status": true,
  "msg": "string",
  "data": [
    null
  ]
}
```

- `status` (`action213.response.default.status`; boolean, optional) — 操作结果
- `msg` (`action213.response.default.msg`; string, optional) — 提示信息
- `data` (`action213.response.default.data`; array<unknown>, optional) — (add_domain 返回) 域名列表；(batch_del_domain 返回) 删除结果数组


## add_domain / del_domain

## add_domain / del_domain / batch_del_domain

管理反向代理站点的域名绑定。

- **路由**：`POST /mod/proxy/com/{action}/stype`

## add_domain — 添加域名

### 输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| id | 是 | int | 站点 ID |
| site_name | 是 | string | 站点名称 |
| domains | 是 | string | 域名，多个用换行符分隔，可带端口 `domain:8080` |

## del_domain — 删除单个域名

### 输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| id | 是 | int | 站点 ID |
| site_name | 是 | string | 站点名称 |
| domain | 是 | string | 要删除的域名 |
| port | 是 | string | 域名对应端口 |

> **注意**：至少保留一个域名。


## batch_del_domain — 批量删除域名

### 输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| id | 是 | int | 站点 ID |
| site_name | 是 | string | 站点名称 |
| domains | 是 | string | 域名列表，换行分隔 |

## 输出参数
| 参数名称 | 类型 | 描述 |
|----------|------|------|
| status | bool | 操作结果 |
| msg | string | 提示信息 |
| data | list | (add_domain 返回) 域名列表；(batch_del_domain 返回) 删除结果数组 |

## 示例

### add_domain 请求
```bash
curl -X POST "http://192.168.168.213:8888/mod/proxy/com/add_domain/stype" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "id=1&site_name=example.com&domains=www.example.com%0Aapi.example.com:8080&request_time=...&request_token=..."
```

### del_domain 请求
```bash
curl -X POST "http://192.168.168.213:8888/mod/proxy/com/del_domain/stype" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "id=1&site_name=example.com&domain=api.example.com&port=8080&request_time=...&request_token=..."
```

