---
title: SetRAAgentTokenUrl
description: "设置远程证明Agent通信的URL，支持配置域名或IP+端口。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengcctrustzone/tee/kdcl/kdcl_kfzn_017.html
sourcePath: /source/zh/kunpengcctrustzone/tee/kdcl/kdcl_kfzn_017.html
indexId: 6f96a9624a8980795b0c66d4c8e370300d65e5a59e0a7407867a8d0352343d8457
---
# SetRAAgentTokenUrl

设置远程证明Agent通信的URL，支持配置域名或IP+端口。

#### 头文件

```
#include "kdc_proxy.h"
```


#### 函数原型

```
uint32_t SetRAAgentTokenUrl(const char *url);
```


#### 参数说明

| 参数 | 参数类型 | 是否必选 | 描述 |
| --- | --- | --- | --- |
| url | const char\* | 是 | 远程证明Agent通信URL，支持域名或IP+端口 示例1：https://api.example.com/global\-trust\-authority/agent/v1/tokens(https://api.example.com/global\-trust\-authority/agent/v1/tokens) 示例2：https://127.0.0.1:8080/global\-trust\-authority/agent/v1/tokens(https://127.0.0.1:8080/global\-trust\-authority/agent/v1/tokens) |


#### 返回值说明

| 返回值 | 含义 |
| --- | --- |
| 0 | 成功 |
| 非0 | 失败，参数无效或URL格式错误 |


#### 使用示例

```
uint32_t ret = SetRAAgentTokenUrl("https://api.example.com/global-trust-authority/agent/v1/tokens");
if (ret != 0) {
// 处理错误
}
```
