How get user IP at browser without outside APIs? [duplicate] - javascript

This question already has answers here:
How to get client's IP address using JavaScript? [closed]
(31 answers)
Closed 6 months ago.
I'm looking for a resolution, how can I get user public IP using only my page. My assumption is not connect to external applications to keep application safe. Page has been built with a ReactJS. Is it possible to do from browser and only JavaScript level? Or do I have to create my custom API to get user IP?
Thanks you advance.

https://codesandbox.io/s/how-to-get-user-ip-address-in-reactjs-kh3xl?from-embed=&file=/src/App.js:140-145
This might be what you're looking for ;)

Related

Javascript stopping people from seeing api and server keys [duplicate]

This question already has answers here:
How do I hide javascript code in a webpage?
(12 answers)
Closed 12 months ago.
Is there a way I can stop people from seeing the Javascript Source code that includes the Server API key and server information?
No, there is not.
You can obfuscate and minify your code, but that doesn't help since your users can look at their browser's Network Inspector instead.

Is it possible to possible update registry values using a client side programming language [duplicate]

This question already has answers here:
How to change registry settings on a system through web browser
(4 answers)
Closed 5 years ago.
I am new to penetration testing. My requirement is to update registry values from browser using a client side programming language like javascript. Is it possible?
No, JavaScript can't read / write arbitrary files to the hard disk, copy them or call programs. It does not have direct access to the operating system.
This is done for the security of users, so that an attacker could not use JavaScript to obtain personal data or somehow damage the user's computer.

Why big websites don't prefer localstorage over cookie? [duplicate]

This question already has answers here:
Local Storage vs Cookies
(9 answers)
Closed 6 years ago.
I'd like to ask why big players like facebook, google still uses cookies if localstorage is much better and secure for same.
They are not the same thing at all: you can use them in a similar way, but they serve different purposes.
Take a look at this thread: Local Storage vs Cookies

Show javascript code ONLY if the visitor is from Specific Country? [duplicate]

This question already has answers here:
is there a good PHP geolocation service? [closed]
(4 answers)
Closed 8 years ago.
Trying to make an ad on my website which would only show for Visitors from Russia, but don't want other countries for it to see?
what would be the easiest way to create something like this?
Get MaxMinds GeoLite GeoIP databases. From there on, you can compare your visitors IP up against that database.

Is possible read the browser history with JS? [duplicate]

This question already has answers here:
Is it possible to detect a visitor's browsing history using JavaScript or PHP?
(5 answers)
Closed 9 years ago.
Is possible read the browser history with Javascript? If the answer is Yes, how can I do it?
I want to read it and save it in a JS variable.
No. Other sites visited by a user are their business, not the business of every website they visit. Browsers do not expose that information to web sites.
Browsers go to pretty serious lengths to plug anything that could leak a user's history to websites
In general history is protected by the browser against javascript accessing it except through back and forward functionality.
Source From : Access my entire browsing history via Javascript

Categories