title: Using a http proxy with Apache Camel's http4 endpoint
body: <p>I'm attempting to use a http proxy with Camel's http4 component. The proxy works when testing using Intellij's HTTP Proxy "Check Connection" option. </p>
  
  <p>However I don't know how to configure it correctly via Camel. When running the following integration test a "ConnectException: Connection timed out" is thrown. Can anyone clarify how to set the proxy details correctly please?</p>
  
  <pre><code>public class SimpleHttpProxyIT extends CamelTestSupport {
      public static final String DIRECT_START = "direct:start";
      public static final String MOCK_RESULT = "mock:result";
  
      @Produce(uri = DIRECT_START)
      protected ProducerTemplate basic;
  
      @EndpointInject(uri = MOCK_RESULT)
      protected MockEndpoint resultEndpoint;
  
      @Test
      public void testBasic() throws Exception {
          basic.sendBody(null);
          resultEndpoint.setExpectedMessageCount(1);
          resultEndpoint.assertIsSatisfied();
      }
  
      @Override
      public RouteBuilder createRouteBuilder() throws Exception {
  
          return new RouteBuilder() {
              @Override
              public void configure() throws Exception {
                  from(DIRECT_START)
                          .id("SunriseTest")
                          .log(LoggingLevel.INFO, "About to hit sunrise")
                          .setHeader(Exchange.HTTP_URI, simple("http://api.sunrise-sunset.org/json?lat=36.7201600&amp;lng=-4.4203400"))
                          .process(new Processor() {
                              @Override
                              public void process(Exchange exchange) throws Exception {
                                  exchange.getProperties().put("http.proxyAuthHost", "myproxy.company.org");
                                  exchange.getProperties().put("http.proxyAuthPort", "10000");
                                  exchange.getProperties().put("http.proxyAuthMethod", "Basic");
                                  exchange.getProperties().put("http.proxyAuthUsername", "myusername");
                                  exchange.getProperties().put("http.proxyAuthPassword", "mypassword");
                              }
                          })
                         .recipientList(simple("http4:dummyhost"))
                          .log(LoggingLevel.INFO, "Done")
                          .to(MOCK_RESULT);
              }
          };
      }
  }
  </code></pre>