有什么方法可以在 JavaScript/Angular 中生成本地计算机的唯一且可预测的 ID?

发布于 2025-01-10 05:39:56 字数 686 浏览 1 评论 0原文

我们有几台计算机运行 Microsoft Edge(无法更改浏览器)。

我们有一个中央网络服务器,其中为每台计算机创建页面。我希望这些计算机的用户能够输入单个 URL 并重定向到该计算机的特定页面。因此,如果我在计算机 A 上输入 www.foo.com,我希望重定向到页面 www.foo.com/A

过去似乎有一种方法可以通过 Chrome 和 Firefox 中的 WebRTC 获取私有 IP 来实现此目的: 您可以通过 JavaScript 获取用户本地 LAN IP 地址吗?

这也适用于我们的情况,但从我读到的内容来看,它不再可能在大多数浏览器从未出现过用Edge可以实现,我尝试的时候确实不行。

理论上,我们可以在每台可以获取 IP 的计算机上运行一个服务,但由于许多实际原因,这不是一个选择。

但它不一定是 IP,任何唯一标识符都可以。有没有什么方法可以生成每台计算机唯一且在后端可预测的 id?

We have several computers running Microsoft Edge (no option to change the browser).

We have a central web server with pages created for each individual computer. I want users of these computers to be able to enter a single URL and be redirected to the specific page for that computer. So if I enter www.foo.com on computer A, I want to be redirected to the page www.foo.com/A.

In the past there seems to have been a way to do this by getting the private IP via WebRTC in Chrome and Firefox: Can You Get A Users Local LAN IP Address Via JavaScript?

That would also work in our case, but from what I read it is no longer possible in most browsers and has never been possible with Edge, and it indeed does not work when I try it.

We could theoretically run a service on each computer that we can fetch the ip from but that is not an option for many practical reasons.

But it doesn't need to be the IP, any unique identifier would do. Is there ANY way of generating an id that would be unique to each computer and also predictable in the backend?

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

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

发布评论

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

评论(1

┈┾☆殇 2025-01-17 05:39:56

通过MacAddress可以识别计算机,老版本的IE中有获取mac地址的方法(通过ActiveX,可以找到解决方案),但现在不可能了,这是有原因的——安全。

我认为,您应该放置有关重定向到服务器的逻辑,例如对于 nginx,您可以添加规则列表,您可以在其中知道每个 mac 地址应该去哪里。

It's possible to identify computer through MacAddress and there was a way to get mac address in old versions of IE(through ActiveX, you can find solutions), but now it's not possible and there is a reason for that - security.

I think, you should place this logic about redirecting to the server, e.g. for nginx you can add list of rules where you can tell, where every mac address should go.

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