Proxy configuration support in Spring

Spring supports proxy configuration. We just need to configure the bean SimpleClientHttpRequestFactory which has a property proxy with java.net.Proxy bean. A sample configuration is shown in the following code:

<bean id="requestFactory" class="org.springframework.http.client.SimpleClientHttpRequestFactory">
  <property name="proxy">
  <bean id="proxy" class="java.net.Proxy">
    <constructor-arg>
    <util:constant static-field="java.net.Proxy.Type.HTTP"/>
    </constructor-arg>
    <constructor-arg>
    <bean class="java.net.InetSocketAddress">
      <constructor-arg value="123.0.0.1"/>
      <constructor-arg value="8080"/>
    </bean>
    </constructor-arg>
  </bean>
  </property>
</bean>

Spring Integration support for HTTP

Spring provides extended support ...

Get Mastering Spring Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.