private ConnectionInfo parseForwardedInfo(
            ConnectionInfo connectionInfo,
            String forwardedHeader) {
        String forwarded = forwardedHeader.split(",", 2)[0];
        Matcher forMatcher = FORWARDED_FOR_PATTERN.matcher(forwarded);
        if (forMatcher.find()) {
            connectionInfo = connectionInfo.withRemoteAddress(AddressUtils.parseAddress(
                    forMatcher.group(1)
                            .trim(),
                    connectionInfo.getRemoteAddress()
                            .getPort(),
                    true));
        } else if (isForwardedIpRequired) {
            throw new IllegalArgumentException(
                    "The \"for\" directive must be specified in the \"Forwarded\" header");
        }
        Matcher protoMatcher = FORWARDED_PROTO_PATTERN.matcher(forwarded);
        if (protoMatcher.find()) {
            connectionInfo = connectionInfo.withScheme(protoMatcher.group(1)
                    .trim());
        }
        Matcher hostMatcher = FORWARDED_HOST_PATTERN.matcher(forwarded);
        if (hostMatcher.find()) {
            connectionInfo =
                    connectionInfo.withHostAddress(AddressUtils.parseAddress(hostMatcher.group(1),
                            getDefaultHostPort(connectionInfo.getScheme()),
                            true));
        }
        return connectionInfo;
    }
@author James Chen
@see reactor.netty.http.server.DefaultHttpForwardedHeaderHandler
turms-gateway/src/main/java/im/turms/gateway/access/client/websocket/HttpForwardedHeaderHandler.java