public class IpUtils extends Object
Constructor and Description |
---|
IpUtils() |
Modifier and Type | Method and Description |
---|---|
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
SocketException
public static String getRealIp(HttpRequest request)
request
- public static String getRealIp(ChannelContext channelContext, HttpConfig httpConfig, Map<String,String> httpHeaders)
channelContext
- httpConfig
- httpHeaders
- public static boolean isIp(String str)
str
- Copyright © 2021. All rights reserved.