Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebRTC Data Sync Feedback #1683

Open
arvinxx opened this issue Mar 22, 2024 · 71 comments
Open

WebRTC Data Sync Feedback #1683

arvinxx opened this issue Mar 22, 2024 · 71 comments
Assignees

Comments

@arvinxx
Copy link
Contributor

arvinxx commented Mar 22, 2024

We use this issue to track all WebRTC relative data sync issue

我们使用本 issue 来跟踪所有数据同步相关的问题,任何和数据同步相关的问题,请在此问题下记录

@coulsontl
Copy link
Contributor

使用Docker部署的应用,然后NGINX反代;在同一台电脑上开多个窗口,多个窗口之间的确可以同步,但是2个不同的设备(电脑和手机)都显示已连接,但是不会同步。已确认频道名称和密码都是一样的。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Use Docker to deploy applications, and then use NGINX to reverse generation; open multiple windows on the same computer, and the multiple windows can indeed be synchronized, but two different devices (computer and mobile phone) are displayed as connected, but will not be synchronized. . Confirmed that the channel name and password are the same.

@linth2005
Copy link

不太理解,为什么同步需要两个设备同时在线,如果一个是公司电脑,一个是家里电脑,这个场景下就无法使用功能同步呀

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I don’t quite understand why synchronization requires two devices to be online at the same time. If one is a company computer and the other is a home computer, functional synchronization cannot be used in this scenario.

@arvinxx
Copy link
Contributor Author

arvinxx commented Mar 22, 2024

不太理解,为什么同步需要两个设备同时在线

这个是和 WebRTC 本身的通信特性有关系,由于目前的技术选型(纯前端、无服务端)的情况下,两个设备的数据同步只能通过点对点通信的形式达成。当一个设备在线,一个设备离线的情况下,我们无从感知数据到底应该从哪来,只有当两台设备都在线的时候,双发数据才能通信。

其实这种模式更像是一个在线聊天室,大家都在线时才能看到对方的数据,然后达成同步。

如果一个是公司电脑,一个是家里电脑,这个场景下就无法使用功能同步呀

是的,你说的没错,那这也我实现完这个功能之后发现的问题。WebRTC 这种纯点对点的方式在某些情况下并无法完全满足用户的诉求,同时也存在一些数据同步层面的问题。这也是我认为这个功能目前也仅算是「实验」的原因。

但是这个模式最大的意义,是让我确信,基于 YJS 我们可以很轻松地实现跨端的数据同步,至于 WebRTC,只是达成同步的一个模式而已 。而我们未来更进一步的,则是在 YJS 这个同步引擎基础上,引入更多的服务端存储层,例如 基于 Redis 的 Upstash 、MongoDB 、甚至于 S3 、文件系统等等。而到这个时候,就是我们的云同步体验达到完美的阶段。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I don’t quite understand why synchronization requires two devices to be online at the same time.

This is related to the communication characteristics of WebRTC itself. Due to the current technology selection (pure front-end, no server), data synchronization between two devices can only be achieved through point-to-point communication. When one device is online and the other is offline, we have no way of knowing where the data should come from. Only when both devices are online can dual-send data communicate.

In fact, this model is more like an online chat room. Only when everyone is online can they see each other's data and then achieve synchronization.

If one is a company computer and the other is a home computer, function synchronization cannot be used in this scenario.

Yes, you are right, then this is also a problem I discovered after implementing this function. The purely point-to-point approach of WebRTC cannot fully meet the needs of users in some cases, and there are also some data synchronization issues. This is why I think this feature is only an "experiment" at the moment.

But the greatest significance of this model is that it convinces me that based on YJS we can easily achieve cross-end data synchronization. As for WebRTC, it is just a model for achieving synchronization. What we will go one step further in the future is to introduce more server-side storage layers based on the YJS synchronization engine, such as Redis-based Upstash, MongoDB, and even S3, file systems, etc. By this time, our cloud synchronization experience has reached the perfect stage.

@arvinxx
Copy link
Contributor Author

arvinxx commented Mar 22, 2024

使用Docker部署的应用,然后NGINX反代;在同一台电脑上开多个窗口,多个窗口之间的确可以同步,但是2个不同的设备(电脑和手机)都显示已连接,但是不会同步。已确认频道名称和密码都是一样的。

@coulsontl 有没有试过换一个网络呀

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Use the application deployed by Docker, and then use NGINX to reverse the generation; open multiple windows on the same computer, and the multiple windows can indeed be synchronized, but two different devices (computer and mobile phone) show that they are connected, but they will not Synchronize. Confirmed that the channel name and password are the same.

@coulsontl Have you tried changing the network?

@coulsontl
Copy link
Contributor

使用Docker部署的应用,然后NGINX反代;在同一台电脑上开多个窗口,多个窗口之间的确可以同步,但是2个不同的设备(电脑和手机)都显示已连接,但是不会同步。已确认频道名称和密码都是一样的。

@coulsontl 有没有试过换一个网络呀

试过,不行

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Use the application deployed by Docker, and then use NGINX to reverse the generation; open multiple windows on the same computer, and the multiple windows can indeed be synchronized, but two different devices (computer and mobile phone) show that they are connected, but they are not connected. will be synchronized. Confirmed that the channel name and password are the same.

@coulsontl Have you tried changing the network?

Tried, doesn't work

@arvinxx arvinxx changed the title [Bug] WebRTC Data Sync issue WebRTC Data Sync Feedback Mar 22, 2024
@ccdanpian
Copy link

ccdanpian commented Mar 23, 2024

使用Docker部署的应用,然后NGINX反代;在同一台电脑上开多个窗口,多个窗口之间的确可以同步,但是2个不同的设备(电脑和手机)都显示已连接,但是不会同步。已确认频道名称和密码都是一样的。

@coulsontl 有没有试过换一个网络呀

试过,不行

和我的情况不太一样,我是分别用vercel和本地docker部署的:
在PC上把vercel和本地docker的都打开,这两个之间可以同步;
手机用自己sim卡上网的时候,无法和PC同步;
手机网络换成和PC一样的WIFI,可以合PC同步

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Use the application deployed by Docker, and then use NGINX to reverse the generation; open multiple windows on the same computer, and the multiple windows can indeed be synchronized, but two different devices (computer and mobile phone) show that they are connected, but Will not sync. Confirmed that the channel name and password are the same.

@coulsontl Have you tried changing the network?

Tried, doesn’t work

The situation is different from mine. I deployed it using vercel and local docker respectively:
Open both vercel and local docker on the PC, and the two can be synchronized;
When the mobile phone uses its own SIM card to access the Internet, it cannot synchronize with the PC;
Change the mobile network to the same WIFI as the PC, and you can synchronize it with the PC

@ccdanpian
Copy link

问题:现在是指同步聊天记录,不会同步设置里的配置参数吗?

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Question: Now it means synchronizing chat records, but will it not synchronize the configuration parameters in the settings?

@GentlemanHu
Copy link

https://github.com/vrtmrz/obsidian-livesync
看到Obsidian这个实时同步插件,看起来不错,能否借鉴一下

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


https://github.com/vrtmrz/obsidian-livesync
I saw the real-time synchronization plug-in Obsidian. It looks good. Can you learn from it?

@arvinxx
Copy link
Contributor Author

arvinxx commented Mar 29, 2024

@GentlemanHu 看了下不会采用,它需要用户手动处理冲突,体验很不好的。我们后续的方案可以做到完全无冲突

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@GentlemanHu After looking at it, I won’t adopt it. It requires users to manually handle conflicts, and the experience is very bad. Our subsequent plans can be completely conflict-free

@sherlcok314159
Copy link

同步一直没成功过,换了好几个版本也没成功过 (mac-win firefox),内网,外网都不行。

同时,看起来还会向 wss://y-webrtc-signaling.lobehub.com/ 发送连接,我的数据是安全的吗?

另外,我认为 webrtc 是个糟糕的选择,理由如下:

  • 借助这种同步方式,得设备同时在线,这太鸡肋了吧,合着我要同步还得另一台保持开启?
  • 如果同步中网络出现问题,数据是否会传输完毕,丢失情况以及后处理逻辑都需要考虑,一点不简洁

为什么不把数据放到本地呢?借助 docker volumes 或许你根本不需要多写什么逻辑,多端根本不需要同步,而且十分稳定,我觉得你花时间重构这部分代码比你折腾 rtc 更有效率。当然,还是尊重作者的个人倾向,很赞的工具!

以上

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The synchronization has never been successful, even after changing several versions (mac-win firefox), neither on the internal network nor on the external network.

Also, it looks like a connection is being sent to wss://y-webrtc-signaling.lobehub.com/, is my data safe?

Also, I think webrtc is a bad choice for the following reasons:

  • With this synchronization method, all devices must be online at the same time. Isn’t this too useless? If I want to synchronize, I have to keep the other device turned on?
  • If there is a problem with the network during synchronization, whether the data will be transmitted completely, the loss situation and the post-processing logic need to be considered, which is not simple at all.

Why not put the data locally? With docker volumes, you may not need to write any more logic at all. The multiple terminals do not need to be synchronized at all, and they are very stable. I think it is more efficient for you to spend time refactoring this part of the code than to toss around rtc. Of course, I still respect the author’s personal preferences. It’s a great tool!

above

@coulsontl
Copy link
Contributor

coulsontl commented Mar 31, 2024

找到问题了,之前为了防止DNS泄露,开了Chrome的 WebRTC Network Limiter 插件,把这个插件关了就好了;希望作者能出个离线同步的功能。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I found a pattern. As long as the device using lobehub and the machine where lobehub is deployed are in the same LAN, they will never be synchronized. If they are not in the same LAN, it will be fine.

@wahyd4
Copy link

wahyd4 commented Apr 1, 2024

+1 to leverage Docker volumes + Sqlite, so basically store history, API Key credentials in DB instead of in Browser.

@MapleEve
Copy link
Contributor

MapleEve commented Apr 1, 2024

同步一直没成功过,换了好几个版本也没成功过 (mac-win firefox),内网,外网都不行。

同时,看起来还会向 wss://y-webrtc-signaling.lobehub.com/ 发送连接,我的数据是安全的吗?

另外,我认为 webrtc 是个糟糕的选择,理由如下:

  • 借助这种同步方式,得设备同时在线,这太鸡肋了吧,合着我要同步还得另一台保持开启?
  • 如果同步中网络出现问题,数据是否会传输完毕,丢失情况以及后处理逻辑都需要考虑,一点不简洁

为什么不把数据放到本地呢?借助 docker volumes 或许你根本不需要多写什么逻辑,多端根本不需要同步,而且十分稳定,我觉得你花时间重构这部分代码比你折腾 rtc 更有效率。当然,还是尊重作者的个人倾向,很赞的工具!

以上

后面应该会有版本自己部署信令服务器的,其实就是一个频道中转,和聊天一样。数据存本地也必须基于 yjs 的同步协作框架,必须后端部署 wss 和持久化的数据库。不过我估计有后端的应该是 saas服务了

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Synchronization has never been successful, even after changing several versions (mac-win firefox), neither on the internal network nor on the external network.

Also, it looks like a connection is being sent to wss://y-webrtc-signaling.lobehub.com/, is my data safe?

Also, I think webrtc is a bad choice for the following reasons:

  • With this synchronization method, the devices must be online at the same time. Isn’t this too useless? If I want to synchronize, I need to keep the other one turned on?
  • If there is a problem with the network during synchronization, whether the data will be transmitted completely, the loss situation and the post-processing logic need to be considered, which is not simple at all.

Why not put the data locally? With docker volumes, you may not need to write any more logic at all. The multiple terminals do not need to be synchronized at all, and they are very stable. I think it is more efficient for you to spend time refactoring this part of the code than to toss with rtc. Of course, I still respect the author’s personal preferences. It’s a great tool!

above

There should be a version in the future that deploys its own signaling server. It is actually a channel relay, just like chat. The local data storage must also be based on the yjs synchronization collaboration framework, and wss and persistent database must be deployed on the backend. But I guess the backend should be a saas service.

@arvinxx
Copy link
Contributor Author

arvinxx commented Apr 1, 2024

同时,看起来还会向 wss://y-webrtc-signaling.lobehub.com/ 发送连接,我的数据是安全的吗?

上述服务的代码在:https://github.com/arvinxx/y-webrtc-signaling/blob/main/index.js ,直接拷贝的官方的代码:https://github.com/yjs/y-webrtc/blob/master/bin/server.js

如果你担心数据安全问题,后续可以提供自行部署信令服务器的选项。但根据你的描述,我感觉后续数据库的版本更适合你。

另外,我认为 webrtc 是个糟糕的选择,理由如下:
借助这种同步方式,得设备同时在线,这太鸡肋了吧,合着我要同步还得另一台保持开启?

其实严格意义上来说,WebRTC 是不适合做数据同步,它像是一个「实时同步」的技术方案。比如同时打开两个浏览器并开启同步的模式情况下,在A浏览器发送的消息可以实时在B浏览器中看到。这个是 WebRTC 所实现的不一样的特性,比如未来我们是否可以基于这种模式实现一个「多人在线的 AI 聊天室」?

不过,我也承认现在这种方案的确存在你说的问题,所以这只是一个「实验性」的技术路径,完美的同步方案不会采用 WebRTC。

如果同步中网络出现问题,数据是否会传输完毕,丢失情况以及后处理逻辑都需要考虑,一点不简洁

换成标准数据库同步方案一样有这种问题吧,数据是否同步到了服务器,丢失了怎么办,后续处理怎么办。但本地优先的方案,至少不会出现刷新页面后本地数据没了的情况。

为什么不把数据放到本地呢?借助 docker volumes 或许你根本不需要多写什么逻辑,多端根本不需要同步,而且十分稳定,我觉得你花时间重构这部分代码比你折腾 rtc 更有效率

如果你说的本地是指服务端数据库,我们后续是会做的:#1768 (comment) 。 但是你说实现这个方案会更有效率,我是不敢苟同的,数据存储一份在本地是 LobeChat 的实现理念,纯服务端的方案也只是一个增量的模式,而不是完全推翻重来。 Local First 的体验会优于 Cloud First (可以查看 https://electric-sql.com 演示的 demo)。

另外一点,我也知道 traditional 数据库方案传统稳定,但是技术/体验创新,往往是非共识下诞生的。作为开源产品而不是商业化产品,我认为是需要在 LobeChat 上尝试新的技术方案,进而诞生新的东西。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Also, it looks like a connection is being sent to wss://y-webrtc-signaling.lobehub.com/, is my data safe?

The code of the above service is at: https://github.com/arvinxx/y-webrtc-signaling/blob/main/index.js. The official code for direct copy: https://github.com/yjs/y-webrtc /blob/master/bin/server.js.

If you are worried about data security issues, you will be provided with the option of deploying your own signaling server later. But based on your description, I feel that subsequent database versions are more suitable for you.

Also, I think webrtc is a bad choice for the following reasons:
With this synchronization method, the devices must be online at the same time. Isn’t this too useless? If I want to synchronize, I have to keep the other device turned on?

In fact, strictly speaking, WebRTC is not suitable for data synchronization. It is like a "real-time synchronization" technical solution. For example, if you check in two browsers at the same time and turn on the synchronization mode, the messages sent in browser A can be seen in browser B in real time. This is a different feature implemented by WebRTC. For example, can we implement a "multiplayer online AI chat room" based on this model in the future?

However, I also admit that this current solution does have the problems you mentioned, so this is just an "experimental" technical path. A perfect synchronization solution will not use WebRTC.

If there is a problem with the network during synchronization, whether the data will be transmitted completely, the loss situation and the post-processing logic need to be considered, which is not simple at all.

If you switch to a standard database synchronization solution, you will still have the same problem. Is the data synchronized to the server? What should I do if it is lost? What should I do with the subsequent processing? But with the local-first solution, at least the local data will not be lost after refreshing the page.

Why not put the data locally? With docker volumes, you may not need to write any more logic at all. Multi-end does not need to be synchronized at all, and it is very stable. I think it is more efficient for you to spend time refactoring this part of the code than to toss with rtc.

If the local you are talking about refers to the server database, we will do the following: #1768 (comment). But you say that implementing this solution will be more efficient. I disagree. Storing data locally is LobeChat's implementation philosophy. The pure server-side solution is only an incremental model, rather than a complete reinvention. The Local First experience will be better than Cloud First (you can view the demo at https://electric-sql.com).

Another point, let me tell you, I also know that traditional database solutions are traditionally stable, but technology/experience innovations are often born out of non-consensus. As an open source product rather than a commercial product, I think it is necessary to try new technical solutions on LobeChat to create something new.

@sherlcok314159
Copy link

这极大程度的解决了我的困惑,很期待你们的创新进展!开源项目就需要这种破旧立新的勇气,支持~,不过作为用户,还是希望尽早看到本地数据库的版本,因为之前一次 bug,数据丢失过一次。当然,还是按照你们自己的开发进度来就好。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


This has solved my confusion to a great extent, and I look forward to your innovative progress! Open source projects require this kind of courage to break the old and create new ones, support~, but as a user, I still hope to see the version of the local database as soon as possible, because a bug caused data loss once before. **Of course, just follow your own development progress. **

@BaituLime
Copy link

SYNC DISABLED!!!!! WHY!!!!!
It's my firefox and chrome both online,
Screenshot 2024-04-02 110329
It's my firefox in my home at the same time.
Screenshot 2024-04-02 110351

@davidreis97
Copy link

Hi, first of all thank you for your work on data sync, it's a key feature for me since I use many devices!

Just one question - from my experiments it seems that agents are currently not being synced across devices. Are there any plans to implement agent sync?

@MapleEve
Copy link
Contributor

#1964
#1962

添加2个使用问题,重度使用的话可能会出现,比如超长文本,写小说,写论文,大段的对话

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


#1964
#1962

Added 2 usage problems, which may occur if used heavily, such as very long texts, writing novels, writing papers, and long dialogues

@shincurry
Copy link

LobeChat can also support websocket. An additional yjs websocket server, user self-host it. yjs websocket server is always running, and can persist yjs document data by using sqlite.

Also, I'm a little surprised that LobeChat uses yjs. I would like to recommend a useful library for yjs, hocuspocusjs, which can easily achieve synchronization and persistence. This is not an advertisement, just a casual mention, because I am also working on a project which use yjs and this library.

@arvinxx arvinxx unpinned this issue Apr 14, 2024
@fanyinghao
Copy link

不太理解,为什么同步需要两个设备同时在线

这个是和 WebRTC 本身的通信特性有关系,由于目前的技术选型(纯前端、无服务端)的情况下,两个设备的数据同步只能通过点对点通信的形式达成。当一个设备在线,一个设备离线的情况下,我们无从感知数据到底应该从哪来,只有当两台设备都在线的时候,双发数据才能通信。

其实这种模式更像是一个在线聊天室,大家都在线时才能看到对方的数据,然后达成同步。

如果一个是公司电脑,一个是家里电脑,这个场景下就无法使用功能同步呀

是的,你说的没错,那这也我实现完这个功能之后发现的问题。WebRTC 这种纯点对点的方式在某些情况下并无法完全满足用户的诉求,同时也存在一些数据同步层面的问题。这也是我认为这个功能目前也仅算是「实验」的原因。

但是这个模式最大的意义,是让我确信,基于 YJS 我们可以很轻松地实现跨端的数据同步,至于 WebRTC,只是达成同步的一个模式而已 。而我们未来更进一步的,则是在 YJS 这个同步引擎基础上,引入更多的服务端存储层,例如 基于 Redis 的 Upstash 、MongoDB 、甚至于 S3 、文件系统等等。而到这个时候,就是我们的云同步体验达到完美的阶段。

基于这个特性,对于个人而言,在数据备份角度,确实是需要有一台(如家庭服务器)的设备长期在线,可以从这个角度考虑增加这样的设备角色,方便用户配置这一台备份设备。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I don’t quite understand why synchronization requires two devices to be online at the same time.

This is related to the communication characteristics of WebRTC itself. Due to the current technology selection (pure front-end, no server), data synchronization between two devices can only be achieved through point-to-point communication. When one device is online and the other is offline, we have no way of knowing where the data should come from. Only when both devices are online can dual-send data communicate.

In fact, this model is more like an online chat room. Only when everyone is online can they see each other's data and then achieve synchronization.

If one is a company computer and the other is a home computer, function synchronization cannot be used in this scenario.

Yes, you are right, then this is also a problem I discovered after implementing this function. The purely point-to-point approach of WebRTC cannot fully meet the needs of users in some cases, and there are also some data synchronization issues. This is why I think this feature is only an "experiment" at the moment.

But the greatest significance of this model is that it convinces me that based on YJS we can easily achieve cross-end data synchronization. As for WebRTC, it is just a model for achieving synchronization. What we will go one step further in the future is to introduce more server-side storage layers based on the YJS synchronization engine, such as Redis-based Upstash, MongoDB, and even S3, file systems, etc. By this time, our cloud synchronization experience has reached the perfect stage.

Based on this feature, for individuals, from the perspective of data backup, it is indeed necessary to have a device (such as a home server) online for a long time. From this perspective, you can consider adding such a device role to facilitate users to configure this backup device.

@BaituLime
Copy link

BaituLime commented May 2, 2024

最近一直连接不上这个信令服务器,可不可以给个IP测试一下ping。
倒是这个链接我可以ping通,但是连不上服务器。
Snipaste_2024-05-03_00-41-48
Snipaste_2024-05-03_00-50-39

@arvinxx
Copy link
Contributor Author

arvinxx commented May 3, 2024

@BaituLime 不知道啥原因这个崩了,我刚重启了,你再试试

image

后续我把这个信令服务端的部署放开来吧,允许大家自行添加。这样估计能解决一部分问题

@denispol
Copy link

denispol commented May 5, 2024

Unfortunately I have trouble getting lobe-chat WebRTC to work in Firefox 125.0.3
Web console returns WebRTC: ICE failed, add a TURN server and see about:webrtc for more details , and here are the logs from about:webrtc in Firefox:

+++++++ BEGIN (process id 19244) ++++++++

(registry/INFO) insert 'ice' (registry) succeeded: ice

(registry/INFO) insert 'ice.pref' (registry) succeeded: ice.pref

(registry/INFO) insert 'ice.pref.type' (registry) succeeded: ice.pref.type

(registry/INFO) insert 'ice.pref.type.srv_rflx' (UCHAR) succeeded: 0x64

(registry/INFO) insert 'ice.pref.type.peer_rflx' (UCHAR) succeeded: 0x6e

(registry/INFO) insert 'ice.pref.type.host' (UCHAR) succeeded: 0x7e

(registry/INFO) insert 'ice.pref.type.relayed' (UCHAR) succeeded: 0x05

(registry/INFO) insert 'ice.pref.type.srv_rflx_tcp' (UCHAR) succeeded: 0x63

(registry/INFO) insert 'ice.pref.type.peer_rflx_tcp' (UCHAR) succeeded: 0x6d

(registry/INFO) insert 'ice.pref.type.host_tcp' (UCHAR) succeeded: 0x7d

(registry/INFO) insert 'ice.pref.type.relayed_tcp' (UCHAR) succeeded: 0x00

(registry/INFO) insert 'stun' (registry) succeeded: stun

(registry/INFO) insert 'stun.client' (registry) succeeded: stun.client

(registry/INFO) insert 'stun.client.maximum_transmits' (UINT4) succeeded: 7

(registry/INFO) insert 'ice.trickle_grace_period' (UINT4) succeeded: 5000

(registry/INFO) insert 'ice.tcp' (registry) succeeded: ice.tcp

(registry/INFO) insert 'ice.tcp.so_sock_count' (INT4) succeeded: 0

(registry/INFO) insert 'ice.tcp.listen_backlog' (INT4) succeeded: 10

(registry/INFO) insert 'ice.tcp.disable' (char) succeeded: \000

(registry/INFO) insert 'ice.forced_interface_name' (string) succeeded:

(registry/INFO) insert 'ice.udp' (registry) succeeded: ice.udp

(registry/INFO) insert 'ice.udp.use_nr_resolver' (char) succeeded: \001

(generic/CRIT) PR_Connect failed: -5980

(ice/INFO) ICE-STREAM(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=) transport-id=transport_0 - 152d8a1d:4b8b9f99053a88fa559a2a8b06ac5810): Skipping STUN server because of address type mis-match

(ice/INFO) ICE-STREAM(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=) transport-id=transport_0 - 152d8a1d:4b8b9f99053a88fa559a2a8b06ac5810): Skipping STUN server because of address type mis-match

(ice/INFO) /builds/worker/checkouts/gecko/dom/media/webrtc/transport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:175 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:IP4:0.0.0.0:19302/UDP)

(ice/INFO) /builds/worker/checkouts/gecko/dom/media/webrtc/transport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:175 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:IP6:[::]:19302/UDP)

(ice/INFO) /builds/worker/checkouts/gecko/dom/media/webrtc/transport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:175 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:IP4:0.0.0.0:3478/UDP)

(ice/INFO) /builds/worker/checkouts/gecko/dom/media/webrtc/transport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:175 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:IP6:[::]:3478/UDP)

(ice/WARNING) /builds/worker/checkouts/gecko/dom/media/webrtc/transport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:639 function nr_socket_multi_tcp_listen failed with error 3

(ice/WARNING) ICE-STREAM(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=) transport-id=transport_0 - 152d8a1d:4b8b9f99053a88fa559a2a8b06ac5810): failed to create passive TCP host candidate: 3

(generic/EMERG) Error in sendto IP4:0.0.0.0:19302/UDP: -5986

(ice/WARNING) ICE(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=))/CAND(srflx(IP4:192.168.x.xx:50534/UDP|IP4:0.0.0.0:19302/UDP)): failed to initialize, 1 remaining

(stun/INFO) STUN-CLIENT(srflx(IP4:192.168.x.xx:50534/UDP|IP4:0.0.0.0:3478/UDP)): Received response; processing

(ice/INFO) ICE(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=)): All candidates initialized

(ice/INFO) ICE(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=)): peer (PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=):default) starting grace period timer for 5000 ms

(ice/NOTICE) ICE(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=)): peer (PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=):default) no streams with non-empty check lists

(ice/NOTICE) ICE(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=)): peer (PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=):default) no streams with pre-answer requests

(ice/INFO) ICE-PEER(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=):default)/CAND-PAIR(ybuq): setting pair to state FROZEN: ybuq|IP4:192.168.x.xx:50534/UDP|IP4:80.xxx.xx.x:40871/UDP(host(IP4:192.168.x.xx:50534/UDP)|candidate:1 1 UDP 1686052863 80.xxx.xx.x 40871 typ srflx raddr 80.xxx.xx.x rport 40871)

(ice/INFO) ICE(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=))/CAND-PAIR(ybuq): Pairing candidate IP4:192.168.x.xx:50534/UDP (7e7f00ff):IP4:80.xxx.xx.x:40871/UDP (647f1fff) priority=7241541910156673535 (647f1ffffcfe01ff)

(ice/INFO) ICE-PEER(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=):default)/ICE-STREAM(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=) transport-id=transport_0 - 152d8a1d:4b8b9f99053a88fa559a2a8b06ac5810): Starting check timer for stream.

(ice/INFO) ICE-PEER(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=):default)/CAND-PAIR(ybuq): setting pair to state WAITING: ybuq|IP4:192.168.x.xx:50534/UDP|IP4:80.xxx.xx.x:40871/UDP(host(IP4:192.168.x.xx:50534/UDP)|candidate:1 1 UDP 1686052863 80.xxx.xx.x 40871 typ srflx raddr 80.xxx.xx.x rport 40871)

(ice/INFO) ICE-PEER(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=):default)/CAND-PAIR(ybuq): setting pair to state IN_PROGRESS: ybuq|IP4:192.168.x.xx:50534/UDP|IP4:80.xxx.xx.x:40871/UDP(host(IP4:192.168.x.xx:50534/UDP)|candidate:1 1 UDP 1686052863 80.xxx.xx.x 40871 typ srflx raddr 80.xxx.xx.x rport 40871)

(ice/NOTICE) ICE(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=)): peer (PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=):default) is now checking

(generic/EMERG) Error in recvfrom: -5961

(ice/WARNING) ICE(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=)): Error parsing attribute:

(ice/INFO) ICE-PEER(PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=):default): no FROZEN/WAITING pairs for PC:{83810e7d-b854-432b-8c06-8fac250b2f49} 1714836810008000 (id=15032385537 url=https://xxx.com/chat?agent=) transport-id=transport_0 - 152d8a1d:4b8b9f99053a88fa559a2a8b06ac5810

(generic/EMERG) Error in recvfrom: -5961

(generic/EMERG) Error in recvfrom: -5961

(generic/EMERG) Error in recvfrom: -5961

(generic/EMERG) Error in recvfrom: -5961

(generic/EMERG) Error in recvfrom: -5961

(generic/CRIT) PR_Connect failed: -5980

(ice/INFO) ICE-STREAM(PC:{d4617d0a-e994-4847-baf6-89f12f7aa910} 1714836814752000 (id=15032385537 url=https://xxx.com/chat?agent=) transport-id=transport_0 - 8ea50d1d:3d261c83f58424403ae250772095b725): Skipping STUN server because of address type mis-match

(ice/INFO) ICE-STREAM(PC:{d4617d0a-e994-4847-baf6-89f12f7aa910} 1714836814752000 (id=15032385537 url=https://xxx.com/chat?agent=) transport-id=transport_0 - 8ea50d1d:3d261c83f58424403ae250772095b725): Skipping STUN server because of address type mis-match

(ice/INFO) /builds/worker/checkouts/gecko/dom/media/webrtc/transport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:175 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:IP4:0.0.0.0:19302/UDP)

(ice/INFO) /builds/worker/checkouts/gecko/dom/media/webrtc/transport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:175 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:IP6:[::]:19302/UDP)

(ice/INFO) /builds/worker/checkouts/gecko/dom/media/webrtc/transport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:175 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:IP4:0.0.0.0:3478/UDP)

(ice/INFO) /builds/worker/checkouts/gecko/dom/media/webrtc/transport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:175 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:IP6:[::]:3478/UDP)

(ice/WARNING) /builds/worker/checkouts/gecko/dom/media/webrtc/transport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:639 function nr_socket_multi_tcp_listen failed with error 3

(ice/WARNING) ICE-STREAM(PC:{d4617d0a-e994-4847-baf6-89f12f7aa910} 1714836814752000 (id=15032385537 url=https://xxx.com/chat?agent=) transport-id=transport_0 - 8ea50d1d:3d261c83f58424403ae250772095b725): failed to create passive TCP host candidate: 3

@AdamsGH
Copy link

AdamsGH commented Jun 2, 2024

Later, I will release the deployment of this signaling server and allow everyone to add it on their own. This is expected to solve some problems.

I can't tell you how much I'm looking forward to this moment, as well as your db implementation =)
And btw, thank's for you job @arvinxx!

@EnergeticMrMask
Copy link

EnergeticMrMask commented Jun 2, 2024 via email

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


This is a holiday automatic reply email from QQ mailbox. Hello, I am currently on vacation and cannot reply to your email personally. I will reply to you as soon as possible after the vacation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Roadmap - Chat 1.x
Development

No branches or pull requests