Tomcat

Add the following line to <Tomcat>/bin/catalana.bat <or .sh>

set "JAVA_OPTS=%JAVA_OPTS% -Dhttp.proxyHost=proxyhostURL -Dhttp.proxyPort=proxyPortNumber -Dhttp.proxyUser=someUserName -Dhttp.proxyPassword=somePassword"

(OR)
Create a new file as setenv.sh inside the <Tomcat>/bin and add the below line to it.

export JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=proxyHostURL -Dhttp.proxyPort=proxyPort -Dhttp.proxyUser=someUserName -Dhttp.proxyPassword=somePassword"

For Tomcat as Windows Service

  1. Open a command prompt with administrator privilege.
  2. Change directory to tomcat bin
  3. Run tomcatXw.exe //ES//CATomcat (or) tomcatXw.exe //ES//TomcatX, where X is your major Tomcat version


  4. Navigate to the Java tab as shown in the above image and enter the following lines under Java Options: field. Ensure that there is no extra space at the end of each line and press the return key to start typing in the next line.

    -Dhttp.proxyHost=proxyhostURL
    -Dhttp.proxyPort=proxyPortNumber
    -Dhttp.proxyUser=someUserName
    -Dhttp.proxyPassword=somePassword
  5. Click OK and restart the service.

MuleSoft ESB

You can set the proxy details on the file, <MULE_HOME>/conf/wrapper.conf. Replace <n> with the number, it is a sequence number of your additional parameters in wrapper.conf.

# Specify an HTTP proxy if you are behind a firewall.

wrapper.java.additional.<n>=-Dhttp.proxyHost=YOUR_HOST

wrapper.java.additional.<n>=-Dhttp.proxyPort=YOUR_PORT

wrapper.java.additional.<n>=-Dhttp.proxyUsername=YOUR_USER_NAME

wrapper.java.additional.<n>=-Dhttp.proxyPassword=YOUR_PASSWORD

If some servers are behind a proxy and if some are not, use the parameter, -Dhttp.nonProxyHosts=*.abc.com" to specify the non-proxy hosts. If you have more than one non-proxy hosts, you can separate them by using the "|' character. For example, -Dhttp.nonProxyHosts="connectall.com|google.com". In this example, both connectall.com and google.com are domains that can be directly reached without a proxy. 

Tip

You could replace HTTP with HTTPS in all the properties for the SSL proxy server.