您可以在不接触服务器的情况下通过 Web 套接字将客户端连接到客户端吗? [英] Can you connect client to client via web sockets without touching the server?

查看:34
本文介绍了您可以在不接触服务器的情况下通过 Web 套接字将客户端连接到客户端吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太知道如何在谷歌中搜索:

I don't quite know how to search this in google:

  • 客户端到客户端的 websocket 连接"
  • 浏览器到浏览器的 websocket"
  • 没有服务器的 websockets"

哈哈,有没有办法让浏览器中的网页上的某个人直接与浏览器中网页上的另一个人通信,而无需接触服务器?

Haha, is there a way for someone on a webpage in the browser to communicate directly to another person on a web page in the browser, without touching the server?

我非常熟悉 socket.io,但这需要所有客户端 emit 消息到服务器,服务器可以broadcast 到其他连接的客户端.不过我不熟悉网络套接字的细节,所以也许有一种方法可以在不通过服务器发送消息的情况下进行通信.

I am very familiar with socket.io, but that requires all clients emit messages to the server, which can broadcast them to the other connected clients. I am not familiar with the details of web sockets though, so maybe there's a way to communicate without sending messages through the server.

这可能吗?我只想知道网络套接字功能的范围,您也可以使用它们的限制等.

Is this possible? I just want to know the scope of web socket functionality, the limits you can take them too, etc.

推荐答案

这不行,你得中间有服务器.

This is not possible, you have to have the server in the middle.

这篇关于您可以在不接触服务器的情况下通过 Web 套接字将客户端连接到客户端吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆