determine OWN IP

hi is there now a simple way to get the OWN IP
within corona from an device thats connected to a WIFI Network?

for now i do it offer socket, but that needs an internet connection
as i have to connect to a domain (in my case google.com)

like

client = socket.connect( “www.google.com”, 80 )
ip, port = client:getsockname()
print ("Connect me at: " … ip)

but even the user has not internet, i should get an internal Wifi IP

thx
chris [import]uid: 4795 topic_id: 26266 reply_id: 326266[/import]

Ciao Chris,

For me, the only system is to query an external server.

I made a simple php script in my server:

[php]

<?php
$ip=$\_SERVER["REMOTE\_ADDR"]; echo $ip; ?\> [/php] Check this temp link: [http://www.ikysasoft.com/onlyforguruk.php](http://www.ikysasoft.com/onlyforguruk.php) Lua code: [lua]local function getIP(params) local url = params.url local timeOut = params.timeOut or 0 local onEvent = params.onEvent local ipAddress = nil local isConnectedToInternet = nil local isTimeOut = nil local timerTimeOut local function goEvent () if type( onEvent ) == "function" then onEvent { isConnectedToInternet = isConnectedToInternet, ipAddress = ipAddress, isTimeOut = isTimeOut, } end end local function listener(event) if isTimeOut == nil then if timerTimeOut then timer.cancel(timerTimeOut) end isTimeOut = false if event.isError == false then isConnectedToInternet = true if event.status == 200 then if event.response and event.response ~= "" then ipAddress = event.response end end else isConnectedToInternet = false end goEvent () end end network.request(url , "GET", listener) if timeOut \> 0 then local function listenerTimerTimeOut (event) if timerTimeOut then timer.cancel(timerTimeOut) end isTimeOut = true goEvent () end timerTimeOut = timer.performWithDelay(timeOut\*1000, listenerTimerTimeOut, 1) end end local function onGetIP (params) if params.isTimeOut == true then native.showAlert( "Timeout", "") else if params.isConnectedToInternet then native.showAlert( "Connected to Internet", "Your IP: "..params.ipAddress) else native.showAlert( "NOT Connected to Internet", "") end end end getIP({ url = "http://www.ikysasoft.com/onlyforguruk.php", timeOut = 4, --secs onEvent = onGetIP })[/lua] Sorry for my english. ciao Simone btw: I am interested on your implementation of dropbox.... if you have some news... ceo at ikysasoft.com ;) [import]uid: 53768 topic\_id: 26266 reply\_id: 106596[/import]

hi thanks for the info.

but i was interested to get a solution without calling any domain in the net :slight_smile:

still with the dropbox functionality i am in work, is quiet a piece of work.
most problem is the last authentication.

greets
chris
[import]uid: 4795 topic_id: 26266 reply_id: 106608[/import]