定制 automattic/jetpack-rtc 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

automattic/jetpack-rtc

最新稳定版本:v0.1.0

Composer 安装命令:

composer require automattic/jetpack-rtc

包简介

Real-time collaboration websocket transport support using WordPress.com infrastructure

README 文档

README

Real-time collaboration websocket transport support using WordPress.com infrastructure.

This package extends Gutenberg's Real-Time Collaboration (RTC) feature with a PingHub WebSocket transport provider, replacing the default HTTP polling with persistent WebSocket connections through the WordPress.com PingHub service.

How to install rtc

Installation From Git Repo

Usage

Add the package as a dependency in your plugin's composer.json:

"require": {
    "automattic/jetpack-rtc": "@dev"
}

Then initialize it in your plugin:

use Automattic\Jetpack\Rtc;

RTC::init();

Architecture

The package has two main layers:

PHP (src/)

  • RTC — Main class. Manages providers, enqueues assets, registers REST routes, and handles the RTC settings.
  • REST_Pinghub_Token — REST endpoint that generates short-lived JWTs for PingHub WebSocket authentication.

JavaScript (src/js/)

  • rtc.ts — Entry point. Registers the PingHub provider via the sync.providers filter.
  • providers/pinghub/ — PingHub provider implementation:
    • pinghub-provider.ts — Yjs provider (thin shell delegating to the manager).
    • pinghub-manager.ts — Per-room sync protocol, awareness, and reconnection logic.
    • pinghub-bridge.ts — WebSocket transport layer.

Contribute

Get Help

Using this package in your WordPress plugin

If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

Security

Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.

License

rtc is licensed under GNU General Public License v2 (or later)

统计信息

  • 总下载量: 39
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-03-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固