public class ForwardedRemoteAddressResolver extends Object implements RemoteAddressResolver
RemoteAddressResolver and
ServerHttpRequest.getRemoteAddress(). Use the static constructor methods which
meets your security requirements.| 限定符和类型 | 字段和说明 |
|---|---|
static String |
X_FORWARDED_FOR
Forwarded-For header name.
|
| 构造器和说明 |
|---|
ForwardedRemoteAddressResolver(int maxTrustedIndex)
Instantiates a new Forwarded remote address resolver.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static ForwardedRemoteAddressResolver |
maxTrustedIndex(int maxTrustedIndex)
Max trusted index forwarded remote address resolver.
|
InetSocketAddress |
resolve(org.springframework.web.server.ServerWebExchange exchange) |
static ForwardedRemoteAddressResolver |
trustAll()
Trust all forwarded remote address resolver.
|
public ForwardedRemoteAddressResolver(int maxTrustedIndex)
maxTrustedIndex - the max trusted indexpublic static ForwardedRemoteAddressResolver trustAll()
public static ForwardedRemoteAddressResolver maxTrustedIndex(int maxTrustedIndex)
maxTrustedIndex - the max trusted indexpublic InetSocketAddress resolve(org.springframework.web.server.ServerWebExchange exchange)
resolve 在接口中 RemoteAddressResolverCopyright © 2020 dromara. All rights reserved.