List of utility methods to do Loopback Address Get
InetAddress | getLoopBackAddress() get Loop Back Address return InetAddress.getByName("127.0.0.1"); |
String | getLoopbackAddress() get Loopback Address try { return InetAddress.getByName("localhost").getHostAddress(); } catch (UnknownHostException e) { throw new RuntimeException(e); |
InetAddress | getLoopbackAddress() Get the loopback interface name. try { for (NetworkInterface netIf : Collections.list(NetworkInterface.getNetworkInterfaces())) { if (netIf == null) { continue; if (netIf.isLoopback()) { Enumeration<InetAddress> addrs = netIf.getInetAddresses(); while (addrs.hasMoreElements()) { ... |