diff --git a/docs/src/reference/docbook/http.xml b/docs/src/reference/docbook/http.xml index 520db17d76..6e0488c12e 100644 --- a/docs/src/reference/docbook/http.xml +++ b/docs/src/reference/docbook/http.xml @@ -169,9 +169,92 @@ By default the HTTP request will be generated using an instance of Si method will be used as the value for URI variable named 'zipCode'. - +
+ HTTP Proxy configuration + + + If you are behind the proxy and need to configure proxy settings for HTTP outbound adapters/gateways you can do + so by providing custom instance of ClientHttpRequestFactory. + You can provide your own implementation of ClientHttpRequestFactory strategy or you can use + implementations already provided by Spring and Apache Commons. + + + + Apache Commons + + + Apache Commons gives you CommonsClientHttpRequestFactory which could be configured with + Proxy aware instance of HttpClient. For simplicity you can encapsulate + the construction logic behind a FactoryBean as in the example below: + + { + + private String proxyHost; + private int proxyPort; + + public CommonsClientHttpRequestFactory getObject() throws Exception { + HttpClient client = new HttpClient(); + client.getHostConfiguration().setProxy(this.proxyHost, this.proxyPort); + CommonsClientHttpRequestFactory requestFactory = + new CommonsClientHttpRequestFactory(client); + return requestFactory; + } + + public Class getObjectType() { + return CommonsClientHttpRequestFactory.class; + } + + public boolean isSingleton() { + return true; + } + public void setProxyHost(String proxyHost) { + this.proxyHost = proxyHost; + } + + public void setProxyPort(int proxyPort) { + this.proxyPort = proxyPort; + } +}]]> + and then configure it with a simple XML configuration: + + + + + +]]> + + + + Spring's SimpleClientHttpRequestFactory + + + You can also use SimpleClientHttpRequestFactory which comes with Spring and configured it as such: + + + + + + + + + + + + + + +]]> + + + We may provide a namespace-based support in the future to simplify configuration + +
+
HTTP Header Mappings