As shown below:
InetAddress addr = ();
String ip = ().toString();//Get the native IP
//The ip of the server accessed is: ("The ip is accessed is:" + ip);
//The visitor's ip is: ("ip is:" + ());
The simple way to obtain local and server IP in the above article is all the content I share with you. I hope you can give you a reference and I hope you can support me more.