How can I detect country where app is running? - coronasdk

Is there a easy way to detect in which country app is running?
I know that I can check IP of client, but I would like to know if there is a easier way to get that info. No location necessary, only country.
Thank you

I would think you would use the GPS to determine that. You can't trust IP addresses because it could be routed through a proxy or something giving you false information.
Rob

Related

Find User location without IP

Can I find the user locaion without the help of IP?
for example, user will access my website but they have masked/hidden their IP, So is there any other way to find the user location and redirect him to as per there locaion in php?
Any help will appreciate.
Thanks in adavance.
I have tried with IP and its working fine but sometime user have masked/hidden the IP so not able to find the location at that time.
I am doing this in PHP

how to change IP geolocation for GeoLite?

I have DNS servers that are showing wrong IP geolocation on MaxMind. I believe that the following site can only be used to change GeoIP but not GeoLite. Can anyone tell me where should I contact to request the change for GeoLite?
https://www.maxmind.com/en/geoip-location-correction
Thank you in advance

Find public IP address of the session user in Grails

I want to request the remote address of the session user in grails. I found a question here which describes the problem (Grails find public IP address of the session user) and the answer really works. I use only request.getRemoteAddr() and I receive 0:0:0:0:0:0:0:1 in my localhost.However, what I have to do to see the real IP address of the user?
In this previous question which I have found it is said "Try looking at the output of request.remoteAddr when viewing the site from a different computer". I really don't know what this means and I need your help here. I can load the server only in my own browser and I use "localhost:8080/..."
Please,tell me how and where to get the correct request. Thanks!!!
"Try looking at the output of request.remoteAddr when viewing the site
from a different computer"
means that you will need to connect to the application running on your machine from another machine in your LAN.
If you have another machine in your LAN, you will need to find your local network IP address (use ipconfig) and from the other machine connect to this address. For example if your IP is 192.168.0.2, connect to http://192.168.0.2:8080
As tim_yates mentioned request.getRemoteAddr() may not always return the correct address due to dynamic addressing and proxy servers. However you may find the original address from various HTTP headers such as: HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR, HTTP_X_FORWARDED
Take a look at the answers to this question which provides more information about this subject.
That's the best you're going to get.
0:0:0:0:0:0:0:1
Is your local address. Also, this cannot be guaranteed to be unique to a user due to dynamic addressing and proxy servers

how to determine location based on ip

how do one determine location based on ip? I'm not asking for any product or service, but rather how to go about implementing it technically.
The ip to country is a rather static mapping. What about more specific locations?
geobyte is a good service to locate ip address. If you are thinking about an algorithm to find location based on IP, I think there is none. It is basically a database look up and you will retrieve the location based on the IP address.

How do I make localhost:3000 available world-wide with my IP adress?

I have a Ruby on Rails application running on localhost:3000. I would like to make it available world-wide, using x.x.x.x:3000 (my IP address).
I'm on Windows XP SP3.
Disable your firewall(s)
Ensure you have port forwarding for your computer enabled in your router (if present)
Thats all! ;)
The key is to run it on the internet facing network adaptor, which might already be doing. You then need to to set up port forwarding on your ADSL or cable modem, if you are behind one (or a similar NAT device). Finally, get a friend to attempt to connect to you.
You might want to use a DNS service to alias your IP address, so people don't have to type it in by hand.
If you specifically need "localhost:3000", then go for #Joe answer, but if you do not care about the URL, you can use https://ngrok.com/.
Simply download it, then run ngrok localhost:3000 in terminal.
You would probably want to ensure that you have a static IP address to start with. You can apply to your ISP for one of these.
You then want to ensure that you have adequate security in place...there are tons of books etc about hardening your server.
If you have a static IP address, you'll need to turn off your firewall and you should be able to reach your machine. (Turning off your firewall isn't really a good idea, but that's a different question.)
If you have a dynamic IP address (you probably do if you're not sure), you need to look into something called "Dynamic DNS", as this will allow our computer to have a constant name, even if the IP address changes. Note that with all the technologies at play these days, your IP address locally is usually not the same one you see publicly. This can be a bit confusing if you're not sure what's going on.
All that being said, most people would opt for some sort of external hosting. This is much better from a security standpoint. Look at heroku for rails hosting. Their free option may be exactly what you need.
If you are running Apache on Windows, there is a button in the Apache tray icon. I can not recall the name but is something like ''go live''. And of course you have to set up the firewall or port forwarding on your router.
You answered your own question. IP addresses are unique over the internet. Just type in the x.x.x.x:3000 and you're there. If you want a human-readable address like yahoo.com, look into dyndns.com or other free domain-name services.

Resources