是否可以在没有中央服务器的情况下创建 LAN Messenger(带有用户验证)?

发布于 2024-12-05 02:56:42 字数 106 浏览 0 评论 0原文

是否可以在没有中央服务器的情况下创建 LAN Messenger(带有用户验证)?

我想使用 JAVA 作为通讯工具并提供视频会议功能。我面临的主要问题是如何/在哪里保存用户的数据。

Is that possible to create a LAN messenger ( with user verification ) without a central server..?

I want to use JAVA for the messenger and with the facility of video conference. The main problem I faced is that how/where will I save user's data.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

阿楠 2024-12-12 02:56:42

如果没有服务器,你的意思是没有任何中央计算机,那么是的,你可以(任何计算机监听并动态扮演服务器角色,或者每个人同时是服务器和客户端)。它可以像 p2p 一样工作。

您还可以使用广播消息来实现这一目标。用户身份验证是问题所在,但您可以在每台计算机上存储用户 ID 和散列密码(并尽可能频繁地同步)

If by without a server you mean without any central computer then yes you can (with any computer listening and dynamically taking server role or something like everyone is server and client simultanously). It could work like p2p.

You could also use brodcast messages to achieve that. User authentication is the issue, but you can store user id's and hashed passwords on each machine (and syncronizing it as often as possible)

何以心动 2024-12-12 02:56:42

我几年前就实现了它:基本上,每次用户打开他的客户端(我已经通过单独的线程完成)时,我都会在 UDP 端口上进行侦听,该端口接受定义用户名、用户 ip 的特定类型的 pkt等等...
这样我就有了一种p2p机制。

用户身份验证是通过以加密方式存储用户密码来实现的(sha5 等..)

I've implemented it some years ago: basically I do a listen on an UDP port for each time a user open his client (I've done that by a separate thread) that accept a particular type of pkt that define username, user ip and so on...
In that way i have a kind of p2p mechanism.

User auth is achived by store user's password in a crypted way (sha5 and so on..)

‖放下 2024-12-12 02:56:42

您可以在每台计算机上本地保存数据。

You can save data locally on each machine.

別甾虛僞 2024-12-12 02:56:42

你可以尝试使用一些DHT作为底层系统。它应该能够处理网络节点之间的所有通信以及分布式数据存储。
如果新节点至少知道网络中已有一个节点,则它可以加入。如果一个节点知道自己的 IP 或 DNS 名称,它就可以向其他节点发送消息。

PS:如果您对这个想法感兴趣,可以查看Open Chord。它唯一的缺点是没有持久性,即除了 RAM 之外它不会将数据存储在任何地方,因此您需要添加自己的持久性。

PPS:您可以创建新的 Skype,但根本没有中央服务器

You can try to use some DHT as an underlying system. It should be able handle all communications between the network nodes as well as distributed data storage.
A new node can join if it knows at least one node that is already in the network. And a node can send a message to some other node if it knows its ip or dns name.

P.S.: If you're interested in the idea you may took a look on Open Chord. Its only drawback is that there's no persistence, i.e. it doesn't store the data anywhere except the RAM, so you'll need to add your own persistence.

P.P.S.: you may event create new skype but without a central server at all

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文