Share this page

# Configuring HTTP proxy on clients

Problem: A virtual service is created on a proxy agent and the user is unable to record messages.

Solution: Configure the HTTP Proxy on clients.

All examples below of specific client configurations are using the proxy server HTTP(S) Proxy Agent listening on address `hostname` with port 6071.

HTTP Proxy in .NET Client

The .NET client can be configured to use a default proxy server or a specific proxy server.

If using the default proxy server, take HTTP Proxy Agent settings to configure the default proxy server. This is done in MS Windows or Internet Explorer in Internet Properties > Connections > LAN settings > Proxy server. You must then configure the client to use the default proxy. This is set in the application configuration file either for application in element `<defaultProxy>`:

    <configuration>

       <system.net>

         <defaultProxy enabled="true">

           <proxy usesystemdefault="true"/>

         </defaultProxy>

       </system.net>

    </configuration>

Or for a specific binding in a binding element:

    <configuration>

       <system.serviceModel>

           <bindings>

              <basicHttpBinding>

                <binding name="myHttpBinding" bypassProxyOnLocal="false" useDefaultWebProxy="true">

                </binding>

              </basicHttpBinding>

            </bindings>

       </system.serviceModel>

    </configuration>

The same configuration file can be used to set a specific proxy server. This is an example of client configuration for application:

    <configuration>

       <system.net>

         <defaultProxy enabled="true">

           <proxy proxyaddress="http://hostname:6071"/>

         </defaultProxy>

       </system.net>

    </configuration>

, or for specific binding:

    <configuration>

       <system.serviceModel>

         <bindings>

           <basicHttpBinding>

             <binding name="myHttpBinding" bypassProxyOnLocal="false" useDefaultWebProxy="false" proxyAddress=" http://hostname:6071">

             </binding>

           </basicHttpBinding>

         </bindings>

       </system.serviceModel>

    </configuration>

HTTP Proxy in Java Client

The proxy settings for Java client are given to the JVM via command line arguments. This is an example of how to run the client from the command line with proxy configuration:

`java -Dhttp.proxyHost=hostname -Dhttp.proxyPort=6071 MyJavaClient`

HTTP Proxy in WebLogic

Add the Java proxy parameters to Java options in `JAVA_OPTIONS` environment variable in the proper section of script`%WL_HOME%\common\bin\commEnv.cmd` for MS Windows or in`${WL_HOME}/common/bin/commEnv.sh` for Unix/Linux. This is example of setting proxy configuration in file `commEnv.cmd` (MS Windows):

    set JAVA_OPTIONS=%JAVA_OPTIONS% -Dhttp.proxyHost=hostname -Dhttp.proxyPort=6071

, or in file `commEnv.sh` (Unix/Linux):

    JAVA_OPTIONS="${JAVA_OPTIONS} -Dhttp.proxyHost=hostname -Dhttp.proxyPort=6071

HTTP Proxy in WebSphere

The HTTP proxy on the WebSphere application server can be configured via setting transport properties `http.proxyHost` and `http.proxyPort`. These HTTP transport properties can be set via:

1. Using wsadmin.

2. Using an assembly tool.

3. Using the JVM custom property panel in the administrative console.

To learn more about (1) and (2), see the Configuring additional HTTP transport properties documentation in WebSphere. To configure the HTTP proxy properties using (3) use the administrative console with the following steps:

1. Open the administrative console.

2. Click Servers > Application Servers > server > Java and Process Management > Process definition > Java Virtual Machine > Custom Properties.

3. (Optional) If the property is not listed, create a new property name.

4. Enter the name `http.proxyHost` and value `hostname`.

5. Enter the name `http.proxyPort` and value `6071`.

6. Restart the server.

HTTP Proxy in JBoss

Add the Java proxy parameters to Java options in `JAVA_OPTS` environment variable in the startup script `%JBOSS_HOME%\bin\run.bat` or `run.conf.bat` for MS Windows or in `${JBOSS_HOME}/bin/run.sh` or `run.conf` for Unix/Linux. This is an example of setting the proxy configuration in `JAVA_OPTS` environment variable in file `run.conf.bat` (MS Windows):

`set "JAVA_OPTS=-Dhttp.proxyHost=hostname -Dhttp.proxyPort=6071`

, or in file run.conf (Unix/Linux):

`JAVA_OPTS="-Dhttp.proxyHost=hostname -Dhttp.proxyPort=6071`

https://admhelp.microfocus.com Service Virtualization 8942
Tips to improve your search results... Service Virtualization Help Center SV Help 5.4-5.4.1 All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: