跳到正文
文章中级

部署实时聊天应用

部署一个无服务器实时聊天应用:每个聊天室都是一个 Durable Object,用户通过 WebSocket 连接,聊天记录保存在持久化存储中。

最近更新
2026年1月29日
阅读原文

该介绍目前仅提供英文版本。

Each chat room is controlled by a Durable Object. Users connect to it with WebSockets, messages are broadcast to everyone in the room, and the history lives in durable storage — a classic example of what Durable Objects are for.

What you’ll learn

  • Clone the chat application
  • Authenticate Wrangler and deploy
  • See how a Durable Object coordinates a room
  • Remove the application when you’re done

Cloudflare products used

Durable Objects, Workers.

Follow the full, step-by-step tutorial in Cloudflare’s documentation.

继续学习