title: Configure Feign OkHttpClient to not use proxy on addresses localhost*
body: <p>I'm having a problem setting the proxy usage for spring-cloud-feign, I'm using the class below to produce an OkHttpClient for Feign:</p>
  
  <pre><code>@Configuration
  public class FeignConfigurationProxy {
  
      @Value ("$ {url.proxy_host}")
      private String HOST_PROXY;
      @Value ("$ {url.proxy_port}")
      private Integer PORT_PROXY;
  
      private OkHttpClient okHttpClient;
      private Proxy proxy;
  
      @PostConstruct
      public void init () {
          buildProxy ();
          buildOkHttpClient ();
      }
  
      @Bean (name = "feign")
      public Feign buildClient () {
          return Feign.builder (). client (new feign.okhttp.OkHttpClient (okHttpClient)).
      }
  
  
      @Bean (name = "okhttpclient")
      public OkHttpClient okHttpClient () {
          return okHttpClient;
      }
  
      public void buildOkHttpClient () {
          buildProxy ();
          okHttpClient = new OkHttpClient.Builder (). proxy (proxy) .build ();
      }
  
      public void buildProxy () {
          proxy = new Proxy (Proxy.Type.HTTP, new InetSocketAddress (HOST_PROXY, PORT_PROXY));
      }
  
  }
  </code></pre>
  
  <p>This solved for the feign clients that make calls to servers outside my network, but now I have a problem with the localhost servers, where I do not need to use the proxy, when I make the calls the feign tries to use the proxy and returns me a cone</p>