将 Web 套接字限制为 LAN 网络
是否可以将 HTML5 WebSocket 限制在 LAN 网络上?
例如,我有一个实时网站,位于 http://example.com,并且所有用户都在同一本地网络上需要被视为一个群体。同样,这些用户将无法查看或影响 LAN 外部用户的任何操作。
我研究过像 NowJS 这样的包装器,它内置了对“组”的支持,但我不确定这是否是我想要的。
有什么想法吗?
Is it possible to restrict HTML5 WebSocket to a LAN network?
For example, I would have a live website, at http://example.com, and all users on the same local network would need to be treated as a group. Similarly, these same users would NOT be able to see or affect any actions of users outside of the LAN.
I have looked into wrappers such as NowJS, and this has built-in support for "groups", but I'm not sure if this is what I'm after.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有权访问用户的 IP 地址,您可以检查前三个段是否相同,并将其用作分组标准。但我想这可能只适用于没有 NAT 的办公室 LAN。
If you have access to the user's IP address, you could check if the first three segments are same and use that as a grouping criteria. But I guess that might work ok only with office LANs without NAT.