跳到正文

Cloudflare Containers

活跃
cloudflare/containers

官方 @cloudflare/containers 类库,用于在 Cloudflare Workers 中运行容器:请求代理、WebSocket 转发、出站拦截、生命周期钩子和负载均衡。

在 GitHub 查看
星标
279
Fork
45
关注
279
未关闭 Issue
65

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

Overview

@cloudflare/containers is the official class for interacting with Containers on Cloudflare Workers. It extends a container-enabled Durable Object with container-specific functionality.

Features

  • HTTP request proxying and WebSocket forwarding
  • Outbound request interception by host or with a catch-all handler, including HTTPS
  • Host allow/deny lists with glob patterns
  • Simple lifecycle management — start and stop containers
  • Event hooks: onStart, onStop and onError
  • A configurable sleep timeout that renews on each request
  • Load-balancing helpers such as getRandom

Installation

npm install @cloudflare/containers

Extend the Container class, set a defaultPort, and route requests to an instance with getContainer.

按共同分类和标签排序的同类开源项目。

全部 DevOps 项目 →