package com.xxl.sso.sample; import java.net.URI; import java.net.URISyntaxException; public class test { public static void main(String[] args) throws URISyntaxException { System.out.println(getIP(new URI("http://www.baidu.com/system/verList")))
Java的api的说法: getHeader public java.lang.String getHeader(java.lang.String name) Return the first value of the specified header, if any; otherwise, return null 返回指定标头的第一个值(如果有的话):否则返回null. Specified by: getHeader in interface javax.servlet.http.HttpSe
public String getUnixLocalIp() { String ip = ""; try { Enumeration<?> e1 = (Enumeration<?>) NetworkInterface.getNetworkInterfaces(); while (e1.hasMoreElements()) { NetworkInterface ni = (NetworkInterface) e1.nextElement(); if (!ni.ge