java如何获取当前机器ip和容器port

获取当前机器ip:

private static String getIpAddress() throws UnknownHostException {

InetAddress address = InetAddress.getLocalHost();

return address.getHostAddress();

}

获取容器port:

String port = String.valueOf(request.getLocalPort());

上一篇:Delphi字符串处理函数


下一篇:Mysql 字符串分隔函数