Would you share the JavaScript code you use to identify public and local IP address?

Richard Zorge asked 1 week ago

In one of your answers you have mentioned that you are using JavaScript to detect public and local IP addresses.  I would like to know how you do that.
I need to identify the client IP addresses in order to prevent abuse of my application by limiting the number of request from the same IP address.
I am doing ASP.Net Core 2.0 development.  I am using HttpContext.Connection.RemoteIpAddress and HttpContext.Connection.LocalIpAddress, but somehow I get different results than your site.  Yours appear to be correct.  So, I would like to try your technique.
Would greatly appreciate any help.

1 Answers
wimiadmin Staff answered 1 week ago

Hi Richard. We won't share our exact code so we can protect our bread and butter. However, I will tell you that the answer is out there on the interwebs. We found several examples when learning to do this ourselves, and rewrote everything to make it work for us.

Know the answer? Login or sign up for an account to answer this question.
Sign Up