This documentation is for WSO2 Enterprise Integrator version 6.1.0 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 1

When using the ESB profile of WSO2 Enterprise Integrator ( WSO2 EI), there can be scenarios where you need to configure the ESB WSO2 EI to route messages through a proxy server. For example, if the ESB WSO2 EI is behind a firewall, your proxy service might need to talk to a server through a proxy server as illustrated in the following diagram:

...

For such scenarios, you need to configure the ESB the WSO2 EI transport sender to forward messages through a proxy server.

Table of Contents

...

Configuring WSO2 EI to route messages through a proxy server

...

See the instructions given below.

...

To configure the ESB profile WSO2 EI to route messages through a proxy server (for non-blocking service calls), add the parameters given below to the axis2.xml file (stored in :

  • Edit the <EI_HOME>/conf/axis2/

...

  • axis2.xml file, and add the following parameters in the <transportSender> configuration of the http transport:
    • http.proxyHost - The host name of the proxy server.
    • http.proxyPort - The port number of the proxy server.

Following is a sample <transportSender> configuration where the parameters mentioned above are set:

Code Block
languagexml
<transportSender name="http" class="org.apache.synapse.transport.passthru.PassThroughHttpSender">    
     <parameter name="non-blocking" locked="false">true</parameter>
    <parameter name="http.proxyHost" locked="false"><>localhost</parameter>
    <parameter name="http.proxyPort" locked="false"><>8080</parameter>
</transportSender>

The parameters are described below.

...

non-blocking

...

http.proxyHost

...

http.proxyPort

...

For blocking service calls

To configure the ESB profile to route messages through a proxy server (for blocking service calls), add the parameters given below to the axis2_blocking_client.xml file (stored in the <EI_HOME>/conf/axis2/ directory) and update the values. This configuration ensures that all HTTP requests pass through the configured proxy server.

Code Block
languagexml
<parameter name="Proxy">
     <parameters>
       <ProxyHost></ProxyHost>
       <ProxyPort></ProxyPort>
       <ProxyUser></ProxyUser>
       <ProxyPassword></ProxyPassword>
     </parameters>
</parameter>

The parameters are described below.

...

ProxyHost

...

ProxyPort

...

ProxyUser

...

ProxyPassword

...

Info
titleBypass the proxy server for blocking calls?

In the case of blocking service calls, you can apply a system property in the ESB profile to bypass the proxy server and route messages directly to the hosts that should receive the messages. Explained below are two methods of applying the system property:

  • Set the system property in the product startup script that is located in the <PRODUCT_HOME>/bin/ directory as shown below. Note that the list of host names are separated by the pipe symbol ('|').

    Code Block
    -Dhttp.nonProxyHosts =10.|localhost|127.0.0.1|.\.domain.com \
  • Pass the system property when you start the server as shown below.

    Code Block
    ./integrator.sh -Dhttp.nonProxyHosts =10.|localhost|127.0.0.1|.\.domain.com

...

When you configure the <transportSender> with the http.proxyHost and http.proxyPort parameters , all HTTP requests pass through the configured proxy server.

Info

A proxy server might require HTTP basic authentication before it handles communication from the ESB profileWSO2 EI

Configuring proxy profiles in

...

WSO2 EI

When using the ESB profileWSO2 EI, there can be scenarios where you need to configure multiple proxy servers to route messages to different endpoints as illustrated in the following diagram.

...

To configure proxy profiles in the ESB profileWSO2 EI:

  • Edit the <EI_HOME>/conf/axis2/axis2.xml file, add the the proxyProfiles parameter parameter in the <transportSender> configuration of the http transport, and then define multiple profiles based on the number of proxy servers you need to have.

    Info

    When you define a profile, it is mandatory to specify the targetHosts, proxyHost and proxyPort parameters for each profile.

The following is a sample proxy profile configuration that you can have in the <transportSender> configuration of the HTTP http transport:

Code Block
languagexml
<parameter name="proxyProfiles">
      <profile>
          <targetHosts>example.com, .*.sample.com</targetHosts>
          <proxyHost>localhost</proxyHost>
          <proxyPort>3128</proxyPort>
          <proxyUserName>squidUser</proxyUserName>
          <proxyPassword>password</proxyPassword>
          <bypass>xxx.sample.com</bypass>
      </profile>
      <profile>
          <targetHosts>localhost</targetHosts>
          <proxyHost>localhost</proxyHost>
          <proxyPort>7443</proxyPort>
      </profile>
      <profile>
          <targetHosts>*</targetHosts>
          <proxyHost>localhost</proxyHost>
          <proxyPort>7443</proxyPort>
          <bypass>test.com, direct.com</bypass>
      </profile>
 </parameter>

When you configure a proxy profile, following are details of the parameters that you need to define in a <profile>:

ParameterDescriptionRequired
targetHosts

A host name or a comma-separated list of host names for a target endpoint.
Host names can be specified as regular expressions that match a pattern. When targetHosts is specified as an asterisks (*), it will match all the hosts in the profile

Yes
proxyHostThe host name of the proxy server.Yes
proxyPortThe port number of the proxy server.Yes
proxyUserNameThe user name for the proxy proxy server authentication.No
proxyPasswordThe password for password for the proxy p roxy server authentication.No
bypass

A host name or a comma-separated list of host names that should not be sent via the proxy server.

For example, if you want all requests to *.sample.com to be sent via a proxy server, but need to directly send requests to hello.sample.com, instead of going through the proxy server, you can add hello.sample.com as a bypass host name.

You can specify host names as regular expressions that match a pattern.

No