WebSocket 是在重新发明轮子吗?

发布于 2024-11-03 20:23:40 字数 315 浏览 1 评论 0原文

如果我错了,请纠正我...

  1. 我们引入防火墙是为了限制公司员工的互联网访问(并间接“保护”家庭用户)。
  2. 现在 WebSockets 允许应用程序通过端口 80 建立任何通信隧道。

这有什么意义?防火墙从一开始就不应该被发明吗? 如果如我所料,防火墙开始阻止所有 Websocket 通信,那么首先引入它们的意义何在?

更新:我的错误。我错误地认为 WebSockets 允许通过端口 80 进行任意端口转发隧道。但事实并非如此。 WebSocket 专门处理通过端口 80 打开全双工通信。

Correct me if I'm wrong...

  1. We introduced firewalls in order to restrict internet access to their Corporate employees (and indirectly "protect" home users)
  2. Now WebSockets allows applications to tunnel any communication over port 80.

What's the point? Should firewalls have never been invented in the first place?
If, as I expect, firewalls begin blocking all Websockets communication, what is the point of introducing them in the first place?

UPDATE: My mistake. I was under the false impression that WebSockets allowed arbitrary port-forwarding tunneling over port 80. It does not. WebSockets deal exclusively with opening a full-duplex communication over port 80.

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

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

发布评论

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

评论(3

一口甜 2024-11-10 20:23:40

WebSocket 的设计初衷并不是为了方便企业安全管理员,而是为了提供快速的浏览器<->服务器通信;因此,你提出这个问题的观点是无效的; WebSocket 非常适合其预期用途,并且大多数 Web 都不位于公司防火墙后面。

无论如何,许多公司现在都允许将任意数据通过加密隧道传输到互联网,所以这并不是什么新鲜事。通过 WebSocket 进行数据泄露的风险和必要的对策仍然取决于个人安全管理员根据他们对员工的信任程度以及他们有权访问的公司数据的敏感性进行判断。

WebSockets aren't designed to be convenient for corporate security admins, they're designed to provide fast browser <-> server communication; the perspective you're taking in asking this question is thus invalid; WebSockets are great for their intended purpose, and most of the web is not behind a corporate firewall.

Many corporations now allow encrypted tunneling of arbitrary data to the internet anyway, so this is nothing new. The risk of data exfiltration via WebSockets and the necessary countermeasures will still fall on the judgment of individual security admins based on the level of trust they have in their employees and the sensitivity of the corporate data they have access to.

单身情人 2024-11-10 20:23:40

我们引入防火墙是为了限制公司员工的互联网访问(并间接“保护”家庭用户)

引入防火墙并不是为了限制网络内部的活动(尽管可以这样使用)。创建防火墙是为了防止来自网络外部的入侵。

现在,WebSockets 允许应用程序通过端口 80 建立任何通信隧道。

应用程序(非 Web)始终能够通过端口 80 建立任何他们想要的隧道,WebSockets 允许的只是使用 Javascript 在其之间启动全双工连接和服务器。

我想我真的不明白为什么你会认为企业网络会防火墙 WebSocket 流量。 WebSocket 所做的一切就是允许 Web 浏览器和服务器之间建立高效的全双工连接。

We introduced firewalls in order to restrict internet access to their Corporate employees (and indirectly "protect" home users)

Firewalls were not introduced to restrict the activities of the internal side of the network (although they can be used that way). Firewalls were created to prevent intrusion from outside a network.

Now WebSockets allows applications to tunnel any communication over port 80.

Applications (non-web) have always been able to tunnel anything they want over port 80, all that WebSockets allow is for Javascript to be used to intitiate a full-duplex connection between it and the server.

I guess I really don't understand why you would think that corporate networks would firewall WebSocket traffic. All WebSocket does is allows a efficient full-duplex connection between web browser and server.

一紙繁鸢 2024-11-10 20:23:40

首先,在标题中,您暗示 Websocket 可能只是先前想法的较差重新实现(它们实际上是)。然后,在正文中,您将切入有关防火墙的话题,防火墙不仅可以通过 Websocket 绕过。

所以,是的。防火墙不应该被发明,发明者应该预见到 websocket 的发明,或者任何使用可信传输的东西,在本例中为端口 80。

回答你的实际问题,websockets 只是另一种不同类型网络上的抽象层。它们很可能不能替代常规套接字,具体取决于相关软件。

重新发明轮子是开发人员最喜欢的消遣,尤其是非开发人员转型为 Web 开发人员。我想它减轻了不必要的自卑感的痛苦,这种痛苦是由于认识到基本的计算机素养与编程能力不同而引起的。

First, in the title, you imply websockets might be just an inferior reimplementation of a previous idea (which they actually are). Then, in the body text you go on a tangent about firewalls, which can be bypassed by not just websockets.

So, yes. Firewalls should have never been invented and the inventors should have foreseen the invention of websockets, or anything that uses a trusted transport which in this example port 80.

Answering your actual question, websockets are just an another different type of abstraction layer on your network. They are most likely not a substitute for regular sockets depending on relevant software.

Reinventing the wheel is a favorite passtime of developers, especially non-developers turned web developers. I guess it eases the pain of unwarranted inferiority complex, caused by the realisation that basic computer literacy is not the same thing as programming ability.

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