public class ForwardedRemoteAddressResolver extends Object implements org.apache.shenyu.plugin.api.RemoteAddressResolver
RemoteAddressResolver and
ServerHttpRequest.getRemoteAddress(). Use the static constructor methods which
meets your security requirements.| Modifier and Type | Field and Description |
|---|---|
static String |
X_FORWARDED_FOR
Forwarded-For header name.
|
| Constructor and Description |
|---|
ForwardedRemoteAddressResolver(int maxTrustedIndex)
Instantiates a new Forwarded remote address resolver.
|
| Modifier and Type | Method and Description |
|---|---|
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 static final String X_FORWARDED_FOR
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 in interface org.apache.shenyu.plugin.api.RemoteAddressResolverCopyright © 2021 The Apache Software Foundation. All rights reserved.