# Proxies

## 已保存代理列表

`GET /proxies`

```json
{
  "tags": [
    "Proxies"
  ],
  "summary": "已保存代理列表",
  "description": "保存在启动器存储中的代理。**不返回凭据（用户名/密码）。**",
  "responses": {
    "200": {
      "description": "代理摘要信息。",
      "content": {
        "application/json": {
          "schema": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProxySummary"
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```

## 添加代理

`POST /proxies`

```json
{
  "tags": [
    "Proxies"
  ],
  "summary": "添加代理",
  "description": "将代理添加到存储（按端点去重）。传入\n`proxy` 字符串或显式的 `host`/`port` 字段（+ `kind`/`username`/`password`）。\n",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AddProxyRequest"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "已保存代理的摘要信息。",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ProxySummary"
          }
        }
      }
    },
    "400": {
      "description": "代理字符串无法解析 / 未提供 host 和 port。",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```

## 删除代理

`DELETE /proxies/{id}`

```json
{
  "tags": [
    "Proxies"
  ],
  "summary": "删除代理",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "已删除。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "deleted": {
                "type": "boolean",
                "example": true
              },
              "id": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```
