public class IpUtils extends Object
| 构造器和说明 |
|---|
IpUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
getLocalIp()
获取本机 ip
|
static String |
getRealIp(ChannelContext channelContext,
HttpConfig httpConfig,
Map<String,String> httpHeaders)
获取真实ip
|
static String |
getRealIp(HttpRequest request) |
static boolean |
isIp(String str) |
public static String getLocalIp() throws SocketException
SocketExceptionpublic static String getRealIp(HttpRequest request)
request - HttpRequestpublic static String getRealIp(ChannelContext channelContext, HttpConfig httpConfig, Map<String,String> httpHeaders)
channelContext - httpConfig - httpHeaders - public static boolean isIp(String str)
str - strCopyright © 2024. All rights reserved.