class EurekaLoadBalancingExchangeFilterFunction implements ExchangeFilterFunction {

    @VisibleForTesting
    static URI rewrite(URI original, InstanceInfo instance) {
        URI effectiveUri;
        if (original.getScheme().equals(EUREKA_SCHEMA)) {
            boolean secure = StringExt.isNotEmpty(original.getQuery()) && asList(original.getQuery().split("&")).contains("secure=true");
            try {
                effectiveUri = new URI((secure ? "https" : "http") + original.toString().substring(EUREKA_SCHEMA.length()));
            } catch (URISyntaxException e) {
                effectiveUri = original;
            }
        } else {
            effectiveUri = original;
        }
        return UriBuilder.fromUri(effectiveUri).host(instance.getIPAddr()).build();
    }

    public  EurekaLoadBalancingExchangeFilterFunction(EurekaClient eurekaClient,
                                                     Function<URI, String> vipExtractor,
                                                     TitusRuntime titusRuntime);

}