npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

y-websocket-multiplexing

v1.4.5-alpha.5

Published

Websockets provider for Yjs

Downloads

4

Readme

y-websocket-multiplexing

  • fork自y-websocket v1.4.5
  • 修改为ts
  • 增加ws连接多路复用能力

y-protocols

syncProtocol

核心Yjs定义了两种消息类型。

  • YjsSyncStep1:包括发送客户端的状态集。当收到时,客户端应以YjsSyncStep2进行回复。
  • YjsSyncStep2:包括所有丢失的结构和完整的删除集。当收到时,客户端确信它收到了来自远程客户端的所有信息。

在点对点网络中,你可能想引入一个SyncDone消息类型。双方都应该用SyncStep1来启动连接。 当客户端收到SyncStep2时,它应该用SyncDone回复。当本地客户端同时收到SyncStep2和SyncDone时,就可以保证它与远程客户端同步了。

在客户端-服务器模型中,你要以不同的方式处理这个问题。客户端应该用SyncStep1来启动连接。 当服务器收到SyncStep1时,它应该在SyncStep1之后立即回复SyncStep2。 当客户端收到SyncStep1时,它应该用SyncStep2来回复。在收到SyncStep2之后,服务器可以选择发送一个SyncDone,这样客户端就知道同步已经完成。

这种更精细的同步模型有两个原因。

  1. 这个协议可以很容易地在http和websockets的基础上实现。
  2. 服务器应该只回复请求,而不是启动它们。因此,有必要由客户端发起同步。

消息的构造。[messageType : varUint, message definition...]。

注意:一条消息不包括房间名称的信息。这必须由上层协议来处理!