For the Spring Cloud OpenFeign Apache HttpClient 5 integration, register the configured client in the intended Spring configuration:

@Bean
org.apache.hc.client5.http.impl.classic.CloseableHttpClient feignHttpClient() {
    return org.apache.hc.client5.http.impl.classic.HttpClients.custom()
        .setProxy(new org.apache.hc.core5.http.HttpHost(
            "http", "proxy.example", 8080))
        .build();
}

Use a compatible OpenFeign/HttpClient 5 dependency set. HC5 is selected when its classes are available unless spring.cloud.openfeign.httpclient.hc5.enabled is false.

Before diagnosing an ignored bean, check that backend choice and the construction path. An application selecting OkHttp will not use this Apache client; a manually assembled Feign.builder outside Spring has another client input.

Keep the Feign target as the API URL. This client supplies the intermediary host, port and scheme; the HTTP proxy list provides public candidates when that API route permits them. Configure its HC5 credential provider before returning it when the proxy needs an account.

Spring Cloud OpenFeign 4 stopped supporting Apache HttpClient 4. Older feign-httpclient examples with org.apache.http imports and old properties belong to that earlier integration.

Artiglyn mynjee