Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
French gui
19
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 26th Apr 2014 19:07
Hi! Is there a way to get the IP address? I need it for a little app (AGK) running under windows. Thanks.
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 26th Apr 2014 19:15
Which IP address?

-- Jim - When is there going to be a release?
French gui
19
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 26th Apr 2014 19:21
I want IP address that people need to connect to my host app from internet. I use no proxy nor Lan.
French gui
19
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 26th Apr 2014 19:44
I've found a way to get it, but I must rely on a TGC website

Seditious
10
Years of Service
User Offline
Joined: 2nd Aug 2013
Location: France
Posted: 26th Apr 2014 19:56
Ideally what you want to do is query the router for its WAN address, but I'm not sure if there's a universal way to do this (and google doesn't bring up any particularly interesting results).

Alternately you can query an external site such as whatsmyip.net, and read the address from the HTML.
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 27th Apr 2014 01:10
http://ipinfo.io/json
Will return a json object that you can parse for the data.
Do this:
http://ipinfo.io/8.8.8.8/json
And you'll get the info for IP 8.8.8.8
Replace that with whatever IP you need if you want to use that.
They do have a limit of 1,000 per day without a subscription.

ipecho.net/plain will just return the external IP address for the client/user
It doesn't appear to have limits so I'd go with that if all you need is the external IP.
If you need the internal IP for the user I don't think there is a way to do this simply. You'll need to point the user to a website with instructions for Windows on how to do it. The typical way is to look at the results of the command ipconfig
There may be a way to set up a command line to do that or there may even be an exe utility to write that info to a file which you can obtain in your AppGameKit program, but to do that you'll need some sort of launcher for your game. A bat file might work.

Seditious
10
Years of Service
User Offline
Joined: 2nd Aug 2013
Location: France
Posted: 27th Apr 2014 06:49
Quote: "If you need the internal IP for the user I don't think there is a way to do this simply."


If you're developing on Windows you can use the gethostname WinAPI function to get the computer's internal IP.
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 27th Apr 2014 10:30
On Windows you can get a list of them. There can be several.

-- Jim - When is there going to be a release?

Login to post a reply

Server time is: 2024-05-03 03:13:49
Your offset time is: 2024-05-03 03:13:49