Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2022.1

...

Note
titleVersion Compatibility

HTTP traffic files recorded in Virtualize or SOAtest 9.10.x and later cannot be used with 9.9.x versions verions and earlier. 

In this section: 

...

You will need the host, port, and path of the service you are targeting in order to set up basic HTTP connection options. Use the settings you would normally use to directly message the service. 

Anchor
ConnectionSettings
ConnectionSettings
Connection Settings

To specify basic HTTP Reverse proxy connection options, set the following service and listening details in the Proxy Settings Connection tab.

Image RemovedImage Added

Proxy Settings (incoming) 

...

Scroll Table Layout
widths30%,70%

ListenerReverse Proxy

You can choose an a Reverse Proxy HTTP listener Listener that you defined when creating the proxy (see Creating Proxies) from the drop-down menu or use the default listener.

You can also add HTTP listeners in these sectionsReverse Proxy HTTP Listeners from this dialog:

  1. Click New and and specify a name for the listener.
  2. Click Add Port and  and enter a port number. You can enable the message proxy to automatically assign a port by specifying as specifying 0 as the port number. When the proxy is enabled, the assigned port number will appear in the console. The port is randomly assigned every time the message proxy is changed/enabled. You can also send a GET request to the messageProxies API  API endpoint to return the automatically-assigned port number. See Creating and Modifying Assets through the REST API for additional information.  
  3. If the client sends traffic over SSL, enable the Secure option and enable your verification options. See SSL Settings for Reverse Proxy Listener Ports for details.
  4. Click OK to exit the port editor.
  5. Click Add to to add additional ports to the listener or proxy or OK again again to finish adding the listenerproxy.
Proxy listen path

Enter the path where the proxy should listen for incoming connections. To listen to all paths, select "[All]" from the drop-down menu.

No two message proxies can have HTTP proxy connections with the same proxy path or with a path that matches an existing virtual asset’s HTTP path.

See Service Forward Path and Proxy Listen Path for more details.

Proxy URL

Displays the URL that should be given to the AUT.See Directing AUTs to Proxies for additional information.

SSL Settings for Listener Ports

Enable the Use keystore option to configure server side SSL settings.

Image Removed

Configure the following settings:

Scroll Table Layout
widths30%,70%

...

Choose a keystore type from the drop-down menu and click Load.

...

Primary Connection (outgoing) & Secondary Connection (outgoing)

Service URLContains the full URL for the target application (comprising the service host, service port, and forward path). You can enter a complete URL here and/or edit specific components in the following fields. Updates made in one area will be propagated to the other (for example, if you modify the port in the URL, the value in the Service port field will be updated automatically). 
Service host

Enter the host name of the machine where the service resides. This is the machine to which the proxy will send messages.

If you want the proxy to forward to a virtual asset on the local server without consuming an HTTP connection, enter host.virt.internal, localhost, or

Enable the Perform client authentication option to configure client side SSL settings.

Image Removed

Configure the following settings:

Scroll Table Layout
widths30%,70%

...

Choose a keystore type from the drop-down menu and click Load.

Primary Connection (outgoing)

Service URLContains the full URL for the target application (comprising the service host, service port, and forward path). You can enter a complete URL here and/or edit specific components in the following fields. Updates made in one area will be propagated to the other (e.g., if you modify the port in the URL, the value in the Service port field will be updated automatically). 
Service host

Enter the hostname of the machine where the service resides. This is the machine to which the proxy will send messages.

If you want the proxy to foward to a virtual asset on the local server without consuming an HTTP connection, enter localhost or 127.0.0.1 rather than the actual host name.  rather than the actual hostname. When using localhost or 127.0.0.1, the service port must match the port Virtualize is deployed on; when using host.virt.internal the service port is not used. For example, a virtual asset deployed on http://localhost:9080/myVirtualAsset can also be reached using http://host.virt.internal/myVirtualAsset.

Service portEnter the port where the service is listening. This is the port to which the proxy will send messages.
Service forward path

(Optional) Enter the path to which the proxy should forward the messages that it receives. If blank, this defaults to the value in the Proxy listen path field.

If the HTTP proxy is sending messages to messages localhost, you must enter a Service forward path because the proxy doesn't allow forwarding to itself. 

If the Service forward path sends a redirect, the proxy will follow the redirect and then respond back. It will not pass the redirect back to the client.

See Service Forward Path and Proxy Listen Path for more details.

Secondary Connection (outgoing)

Enable the Use secondary connection if primary fails option if you want traffic to be redirected to a secondary proxy endpoint when the primary connection fails or the responder is not available. The connection will be considered "failed" if the response status code is 400 level or higher.

back to the client.

See Service Forward Path and Proxy Listen Path for more details.

Options

Mode: Allows you to set the active forwarding connection when a primary and secondary connection exist. For example, during a recording session, a message proxy may forward to the live service as the primary connection and fall back to a virtual service as a secondary connection. In this case, you can set the HTTP mode to Primary and enable Use other connection if selected mode fails.

Once recording is complete and new virtual assets are generated, you may want to re-configure the proxy to forward to the virtual service first and fall back to the live service if a failure occurs. This change can be quickly applied by right-clicking the proxy and switching the HTTP mode to "secondary". The failover will be adjusted accordingly at runtime.

Image Added

Use other connection if selected mode fails: Enable this option if you want traffic to be redirected to the backup proxy endpoint when the active connection (as determined by the Mode selected above) fails. The connection will be considered "failed" if the response status code is 400 level or higherFor instance, you may specify a secondary endpoint if you want a virtual asset to be used whenever the live endpoint is unavailable. If a virtual asset does not handle a given use case, you may also use a secondary endpoint to redirect traffic to the live endpoint and record the live traffic for creating a new virtual asset to cover that use case.

If this option is not enabled, the primary active connection will be used for recording.

If this option is enabled, you can select a recording option from the available recording options (described below).

Recording options

These settings determine how to record traffic when a secondary endpoint is specified.

Record dropdown:

  • Both Record on both connections: Records traffic for both the primary and secondary connections. Error messages from the primary active connection will not be recorded; instead , the messages will be sent to the secondary backup connection and the responses will be recorded. Errors reported by the secondary backup will be recorded.
  • Record on primary Primary connection only: Records traffic for the primary active connection. Does not record errors.
  • Record on secondary Secondary connection only: Records traffic for the secondary backup connection, including errors.

...

The Service SSL section needs to be completed only if the service you are working with uses SSL.

Image RemovedImage Added

If the service being virtualized and/or the application under test uses SSL and/or other authentication (basic/digest, Kerberos, NTLM), additional configuration may be required.

...

To specify proxy settings at this level, provide the appropriate details in the proxy’s Proxy Server tab. 

Image RemovedImage Added

SSL is not supported. 

...

  1. Set the service host and port to that of the Virtualize Server where the virtual asset is deployed. If you want the proxy to foward forward to a virtual asset on the local server without consuming an HTTP connection, enter, localhost host.virt.internal, localhost, or 127.0.0.1 rather than the actual host name. hostname. When using localhost or 127.0.0.1, the service port must match the port Virtualize is deployed on; when using host.virt.internal, the service port is not used.
  2. Set the proxy connection’s Service forward path to the virtual asset’s path (found in the virtual asset’s Transports> HTTP tab, under HTTP endpoint).

...

You can create a properties file to configure additional Reverse Proxy HTTP listener Listener settings. The properties file allows you to fine-tune Reverse Proxy HTTP listener Listener performance and specify additional SSL settings.

  1. Create a plain text file and specify the properties you want to set (see Reverse Proxy HTTP Listener Message Proxy Performance Properties and  and Reverse Proxy HTTP Listener Message Proxy SSL Properties). 
  2. Save the file to theVirtualAssets the VirtualAssets or TestAssets directory in your workspace and name it embeddedServer.properties.

The file will be read every time a proxy with a Reverse Proxy HTTP listeners Listener is enabled.

Reverse Proxy HTTP Listener

...

Properties

Scroll Table Layout
widths40%,60%

embedded.connector.maxHttpHeaderSizeSpecify the maximum size of the request and response HTTP header (bytes). If not specified, this attribute is set to 8192 (8 KB).
embedded.connector.relaxedPathChars

Specify characters that should be allowed in URI paths in unencoded form. The value may be any combination of the following characters:

" < > [ \ ] ^ ` { | }

Any other characters present in the value will be ignored. If this property is not included, Tomcat will reject unencoded forms of the above characters in URI paths.

Refer to the Tomcat documentation for additional information: https://tomcat.apache.org/tomcat-8.5-doc/config/http.html.

embedded.connector.relaxedQueryChars

Specify characters that should be allowed in URI queries in unencoded form. The value may be any combination of the following characters:

" < > [ \ ] ^ ` { | }

Any other characters present in the value will be ignored. If this property is not included, Tomcat will reject unencoded forms of the above characters in URI queries.

Refer to the Tomcat documentation for additional information: https://tomcat.apache.org/tomcat-8.5-doc/config/http.html.

Reverse Proxy HTTP Listener Message Proxy Performance Properties

All properties are optional and non-integer values will be ignored.

...

embedded.connector.maxThreads

Specify the maximum number of request-processing threads the connector should create. This property determines the maximum number of simultaneous requests that can be handled. Default is 200.

embedded.connector.minThreads

Specify the minimum number of threads that should always be running. Default is 10.

embedded.connector.acceptors

Specify the number of threads that should be used to accept connections. Increase this value on machines with multiple CPUs or when you are using several non-keep-alive connections.1 or 2 is adequate in most cases. Default is 1.

embedded.connector.idleTimeoutSpecify how many milliseconds the connector should wait for another HTTP request before closing the connection. Specify -1 to allow the connector to wait indefinitely. Default is use connectTimeout.
embedded.connector.soLingerTime

Specify how many milliseconds the sockets used by the connector should linger when the sockets are closed. Lingering is disabled by default.

embedded.connector.acceptorPriorityDeltaSpecify the priority of the acceptor threads used to accept new connections. See the java.lang.Thread JavaDoc for additional details. Default is 5.
embedded.connector.acceptQueueSize

Specify the maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is at capacity will be refused. Default is 100.

embedded.connector.connectTimeoutSpecify how many milliseconds the connector should wait for the request URI line to be presented after accepting a connection. Enter -1 to allow the connector to wait indefinitely. Default is 60000.

Reverse Proxy HTTP Listener Message Proxy SSL Properties

Scroll Table Layout
widths40%,60%

...

Assume that we want to create a message for a service that is normally accessed at http://example.parasoft.com:9080/BookStore. We could create an HTTP Reverse proxy with the settings: 

  • Proxy listen path: /BookStore
  • Service host:example.parasoft.com
  • Service port: 9080
  • Service forward path: [empty]
    Image RemovedImage Added

This configuration will listen on /BookStore and forward all traffic to the actual book store service.

If we wanted to listen on a path other than the service path, we would configure change the configuration of the proxy as follows:

  • Service forward path: /BookStore
  • Proxy listen path: /SomeOtherPath
    Image RemovedImage Added

This would route traffic from /SomeOtherPath on the proxy to the actual book store service. 

...

Code Block
X-AUTHORIZATION
ANOTHER-HEADER
HEADER3

Example: Sending Traffic to a Virtual Asset

A proxy can also send traffic to a virtual asset. In that case, enter the host and port information for the Virtualize Server as if were just another service.

For example, to send traffic to a virtual asset on a remote server, you might use: 

  • Proxy listen path: /path
  • Service host: virtualize.parasoft.com
  • Service port: 9080
    Proxy listen path: /path
    Image RemovedImage Added

To send traffic to a virtual asset on a local server, you might use:

  • Service host: localhost [Virtualize]
  • Service port: 9080Service forward path:  /pvapath
    Image RemovedImage Added

The HTTP Reverse proxy makes no distinction between a virtual asset and an actual service. Both are configured the same way. However if the HTTP Reverse proxy is sending to localhost, you must specify specify Service forward path because the proxy doesn't allow forwarding to itself.

...

Depending on your configuration, you configure either security setting or both.

Anchor
Proxy-level Configuration
Proxy-level Configuration
Proxy-level Configuration

Proxy-level security configuration—which is relevant if the service to which you are forwarding the traffic uses SSL and/or access authentication—covers:

...

Additionally, you need to provide the information needed to use a specific key store and certificate so Parasoft can determine which certificate to present to a server (e.g., for 2-way SSL).

Image RemovedImage Added

SSL Configuration Panel Fields

...

If your service requires NTLM authentication, provide the username/password in the NTLM section.

Image RemovedImage Added

Anchor
Kerberos Authentication
Kerberos Authentication
Kerberos Authentication

...