Path: API › Proxy 反向代理

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

管理反向代理站点的 IP 黑白名单。

## Path parameters

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

## Request body

_Required._

- `request_time` (`action218.request_time`; string, required) — Unix 时间戳。
- `request_token` (`action218.request_token`; string, required) — 按 API 概览生成的签名。
- `site_name` (`action218.site_name`; string, required) — 站点名称
- `ips` (`action218.ips`; string, required) — IP 列表，多个用换行符分隔。支持 CIDR 格式如 `10.0.0.0/8`

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "site_name": "string",
  "ips": "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 "site_name=<site_name>" \
  --data-urlencode "ips=<ips>"
```

## Responses

### default

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

#### Example

```json
{
  "code": 0,
  "status": true,
  "msg": "设置成功！"
}
```


## add_ip_limit / del_ip_limit

管理反向代理站点的 IP 黑白名单。

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

## add_ip_limit — 添加 IP 限制

### 输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| site_name | 是 | string | 站点名称 |
| ips | 是 | string | IP 列表，多个用换行符分隔。支持 CIDR 格式如 `10.0.0.0/8` |

> **说明**：IP 限制作用于指定 `proxy_path` 上。若未指定 `proxy_path`，则作用于全局。


## del_ip_limit — 删除 IP 限制

### 输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| site_name | 是 | string | 站点名称 |
| ip_type | 是 | string | 类型：`black` 或 `white` |
| ip | 是 | string | 要删除的 IP 地址 |

## 示例

### add_ip_limit 请求
```bash
curl -X POST ".../mod/proxy/com/add_ip_limit/stype" \
  -d "site_name=example.com&ips=192.168.1.100%0A10.0.0.0/8"
```

### del_ip_limit 请求
```bash
curl -X POST ".../mod/proxy/com/del_ip_limit/stype" \
  -d "site_name=example.com&ip_type=black&ip=192.168.1.100"
```

### 响应
```json
{"code": 0, "status": true, "msg": "设置成功！"}
```

