JavaScript - 两个用户代理是否可以在没有服务器交互的情况下进行通信?
网络是围绕用户代理与服务器对话的理念构建的。但是,我想知道是否有某种方式(也许是 websocket?)两个用户代理(一旦由服务器引入)可以直接与自己对话。
这可能吗?存在什么样的问题?
用户代理通常位于防火墙后面,因此我认为主要问题是从用户代理 A 到用户代理 B 的未请求流量将被阻止,因为用户代理 B 没有这样做。 t 向 A 提出任何请求。
The web is built around the idea of user-agents talking with servers. However, I'm wondering if there is some way (websockets perhaps?) that two user-agents (once introduced by a server) could talk directly with themselves.
Is this possible? What kind of problems exist?
User agents often site behind firewalls, so I would expect that the main problem is that unrequested traffic from user agent A to user agent B would be blocked since user agent B didn't make any requests to A.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于 JavaScript 来说还不可能。
替代方案:
Not possible with JavaScript (yet).
Alternatives:
有一个讨论是关于html5的这个功能最终是否会在现代网络浏览器中实现,以及对此有什么限制。
然而,即使这一举措得以实施,也面临着很多相关问题。最大的一个是您不知道访问您页面的客户端网络的任何详细信息。
客户端可能位于防火墙、反向代理、公司代理、甚至多个防火墙后面。
因此,实际上,即使实现了,这在现实生活中也很难实现。
There a discussion regarding if this feature of html5 will finally by implemented this in modern web browsers, and what would be the restrictions about this.
However, even if this gets implemented, there a lot of related problems to face. The biggest one is that you don't know any detail about the network of the client accessing your page.
The client could be behind a firewall, a reverse proxy, a corporate proxy, even behind multiple firewalls.
So, in practice, this would be difficult to accomplish in real life, even if it gets implemented.