> For the complete documentation index, see [llms.txt](https://smallso.gitbook.io/tencent-cloud-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smallso.gitbook.io/tencent-cloud-sdk/python-docs/other-products/class-and-method/proxies/add-proxy-server.md).

# add\_proxy\_server 方法

命名空间和模块：tencent.cloud.core.proxies.Proxies

## 简要

添加一个新的代理服务器到代理服务器组。

```python
def add_proxy_server(self,
    proxy_name: str,
    proxy_type: str,
    proxy_endpoint: str,
    proxy_auth: dict = None
)
```

## 参数

该方法具有以下参数，其参数、参数类型和参数描述如下：

| 参数              | 类型                                                                                                         | 必选 | 描述                                                          |
| --------------- | ---------------------------------------------------------------------------------------------------------- | -- | ----------------------------------------------------------- |
| proxy\_name     | str                                                                                                        | 是  | <p>代理服务器的名称。</p><p>例如：<code>default</code></p>              |
| proxy\_type     | str                                                                                                        | 是  | <p>代理服务器的类型。</p><p>受支持的代理服务器类型定义在 ProxyType 枚举器。</p>        |
| proxy\_endpoint | str                                                                                                        | 是  | <p>代理服务器的端点主机名和端口。</p><p>例如：<code>127.0.0.1:1081</code></p> |
| proxy\_auth     | [ProxyAuth](https://smallso.gitbook.io/tencent-cloud-sdk/python-docs/other-products/data-types/proxy-auth) | 否  | 包含代理服务器的访问凭据上下文的字典实例。                                       |

## 返回值

该方法没有返回值。

## 异常

该方法可能会主动引发以下异常类型：

#### ValueError

参数值或类型不符合预期。

#### ExistedError

代理服务器组中已存在相同名称的代理服务器配置。

## 适用于

#### Tencent Cloud SDK for Python

基础软件包：tencent-cloud-sdk-core >= 0.1.1
