@Override
    public InetSocketAddress resolve(final ServerWebExchange exchange) {
        List<String> xForwardedValues = extractXForwardedValues(exchange);
        if (CollectionUtils.isNotEmpty(xForwardedValues)) {
            int index = Math.min(xForwardedValues.size(), maxTrustedIndex) - 1;
            return new InetSocketAddress(xForwardedValues.get(index), 0);
        }
        return defaultRemoteIpResolver.resolve(exchange);
    }
Max trusted index forwarded remote address resolver.

@param maxTrustedIndex the max trusted index
@return the forwarded remote address resolver
shenyu-web/src/main/java/org/apache/shenyu/web/forward/ForwardedRemoteAddressResolver.java