> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/contributor/contributor-zh/tong-xin/chuan-shu-lei-xing/livekit.md).

# LiveKit

该 [LiveKit](https://livekit.io/) 传输是受支持的传输方式中最通用、最高效的，也是最容易实现的。客户端应在从其所在 realm 的 [Archipelago](https://github.com/decentraland/docs/tree/main/contributor/archipelago/README.md) 服务，或者如果它被标记为固定传输。

{% hint style="info" %}
你可以使用开源的 [Comms Station](https://decentraland.github.io/comms-station/).
{% endhint %}

不同于自定义的 [websocket](https://github.com/decentraland/docs/tree/main/contributor/transport-types/websocket/README.md) 传输方式，它使用第三方（开源）库，通过抽象出所有传输层逻辑和序列化，极大地简化了开发过程。

LiveKit 传输 URI 以 `livekit:` 前缀开头，后接 `wss://` 服务器 URL。它们还包含一个预授权的 `access_token`，由 [Archipelago](https://github.com/decentraland/docs/tree/main/contributor/archipelago/README.md) 在客户端进行身份验证时生成。

```
livekit:wss://comms.example.com?access_token=eyJhbGciOiJI...
```

### 连接和身份验证

LiveKit 客户端库很好地封装了所有连接和身份验证逻辑。

使用 LiveKit 传输时无需额外的身份验证步骤。 `access_token` Archipelago 提供的已经经过验证并获授权。

### 消息交换

依赖 LiveKit 库的客户端可以轻松地广播、发送直接消息并发布实时媒体流。

载荷是纯通信 [`数据包`](https://github.com/decentraland/docs/tree/main/contributor/messages/README.md) 而无需任何额外封装。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/contributor/contributor-zh/tong-xin/chuan-shu-lei-xing/livekit.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
