> 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/universal-client/set-access-proxies.md).

# set\_access\_proxies 方法

## 简要

设置当前客户端实例访问 Tencent Cloud API 时使用的代理服务器配置。

```python
def set_access_proxies(self,
    access_proxies: proxies.Proxies
)
```

请注意，该方法将立即覆盖当前客户端实例已设置的代理服务器配置。

继承：`tencent.cloud.core.client.BaseClient.set_access_proxies` 方法

## 参数

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

| 参数              | 类型      | 必选 | 描述                                                                                                            |
| --------------- | ------- | -- | ------------------------------------------------------------------------------------------------------------- |
| access\_proxies | Proxies | 是  | <p>代表代理服务器配置的 Proxies 实例。如果需要删除代理服务器配置，请将该参数的值设置为 None。</p><p></p><p>例如：<code>proxies.Proxies(...)</code></p> |

## 返回值

该方法没有返回值。

## 异常

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

#### ValueError

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

## 示例

接下来我们将通过一段 Python 代码向您演示如何使用该方法：

### 设置代理服务器

```python
virtual_machine_client.set_access_proxies(
    access_proxies = proxies.Proxies(
        proxy_name = 'default',
        proxy_type = proxies.ProxyType.Https,
        proxy_endpoint = '127.0.0.1',
        proxy_auth = {
            'username': 'root',
            'password': 'root'
        }
    )
)
```

### 移除代理服务器

```python
virtual_machine_client.set_access_proxies(
    access_proxies = None
)
```

## 适用于

#### Tencent Cloud SDK for Python

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://smallso.gitbook.io/tencent-cloud-sdk/python-docs/other-products/class-and-method/universal-client/set-access-proxies.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
