使用ReactJS将IP输入VPN
我在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ReactJS只是用户界面 - javascript-library。因此,最终您可以使用JavaScript-Ecosystem为您提供的所有内容。
不幸的是,没有API呼叫可以使用JavaScript获取本地IP地址。
获得IP地址的WEBRTC方法实际上被认为泄漏了IP地址。因此,当试图使用poc 。如果您可以完全控制有关计算机,则可以在Chrome浏览器中明确关闭此混淆。
Chrome:// flags
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.
chrome://flags
Anonymize local IPs exposed by WebRTC
to falseAnother 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.