> 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/blob/main/contributor/archipelago/README.md) 服务中收到时使用它，或者如果它被标示为固定传输。

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

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

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

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

### 连接与身份验证

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

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

### 交换消息

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

有效载荷是普通通信 [`数据包`](https://github.com/decentraland/docs/blob/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 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://docs.decentraland.org/contributor/contributor-zh/tong-xin/chuan-shu-lei-xing/livekit.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.
