使用ReactJS将IP输入VPN

发布于 2025-01-24 18:41:50 字数 530 浏览 2 评论 0原文

我在VPN网络中获得了一些客户端计算机,他们在调用ReactJS网站时应根据其IP地址(VPN的静态IP)获取不同的数据。

因此,问题是,由于没有Internet访问,我无法使用IPINFO之类的第三方服务。 我的问题是,是否有一个“本地”选项可以获取IP或其他某些ID,这些ID唯一地标识了VPN中的客户端。 我查看了webrtc选项: https://ourcodeworld.com/articles/read/257/how-to-to-to-te-per-the-client-ip-adress-with-with-javascript-only 但是看来这是不起作用的(至少在提琴手中),

我为任何线索或IDE感到高兴

I got some client computers inside a VPN network who, when calling a ReactJS website, should get different data depending on their IP address (static IP from VPN).

So the problem is, I can not use 3rd Party services like ipinfo since they do not have internet access. My question is, is there a "local" option to do get the IP or some other ID that uniquely identifies the client in the VPN that calls the ReactJS.
I looked at the webRTC option: https://ourcodeworld.com/articles/read/257/how-to-get-the-client-ip-address-with-javascript-only
but is seems that this is not working (at least not in Fiddler)

I am happy for any clue or ides

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

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

发布评论

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

评论(1

葬﹪忆之殇 2025-01-31 18:41:50

ReactJS只是用户界面 - javascript-library。因此,最终您可以使用JavaScript-Ecosystem为您提供的所有内容。
不幸的是,没有API呼叫可以使用JavaScript获取本地IP地址。

获得IP地址的WEBRTC方法实际上被认为泄漏了IP地址。因此,当试图使用poc 。如果您可以完全控制有关计算机,则可以在Chrome浏览器中明确关闭此混淆。

  1. OPEN Chrome:// flags
  2. set webrtc forse to false to forse a norymize aNOMIZE to

另一种方法可能是托管自己的“ whats-my-ip” - lookup-server同一网络。为此,Docker-Hub中有几个Docker-images可用。 喜欢这个 /r/eugenmayer/whats myip“ rel =” nofollow noreferrer“>这个或这个
然后,您可以查询本地网络docker-container,而不是实际的第三方服务。

ReactJS is just a User-Interface-JavaScript-Library. So in the end you could use everything the JavaScript-Ecosystem provides you with.
Unfortunately there is no API-call to get the local ip-address with just JavaScript.

The WebRTC-method of obtaining the IP-address was actually considered leaking the IP-adress. For that reason, the IP-address is now being obfuscated when trying to get the local-ip-lookup with POCs like this. If you have full control over the computers in question you can explicitly turn off this obfuscation in the chrome browser.

  1. Open chrome://flags
  2. Set Anonymize local IPs exposed by WebRTC to false

Another approach could be to host an own "whats-my-ip"-Lookup-Server on the same network. There are a couple of docker-images available in the docker-hub for that purpose. Like this one, this one or this one.
You could then query the local-network-docker-container instead of an actual third-party-service.

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