I'm trying to get my real Public IP even if I use Proxy. After some research I found this command:
nslookup myip.opendns.com resolver1.opendns.com
This is run perfectly on cmd. I mean even if I use proxy it returns my real public IP. I tried to use shellasync to run it on B4A by below code but that is not running perfectly.
B4X:
Sub myip
Dim p As Phone
Wait For (p.ShellAsync("nslookup", Array As String("myip.opendns.com","resolver1.opendns.com"))) Complete (Success As Boolean, ExitValue As Int, StdOut As String, StdErr As String)
If Success Then
Log(ExitValue)
Log(StdErr)
Log(StdOut)
End If
End Sub
Yes, I’m using Android emulator (bluestack) on my desktop. When I ran the code in desktop command prompt it is ok but when I use emulator to run Phone.shellasync I got that message.
Pay attention it works without error on logs or any other crash but it doesn’t return the answer which is returned by command prompt