...
To specify HTTP Forward proxy connection options, set the following service and listening details.
Proxy Settings (incoming)
These settings specify where messages from the client should connect in order to communicate with the application under test. Scroll Table Layout
Forward proxy
...
: You can choose a Forward Proxy HTTP Listener that you defined when creating the proxy (see Creating Proxies) from the menu or add a new Forward Proxy HTTP Listener.
...
To add Forward Proxy HTTP Listeners from this dialog:
- Click New.
- Specify a name and port for the listener.
- Click OK.
Host
...
: Enter the host name of the service whose traffic you want to monitor. This determines which hosts are recorded, sent to the live service, or sent to a virtual asset.
...
To allow monitoring for all traffic, choose [All] from the menu.
Path
...
: Enter a path that you want to monitor on the resource. This works in conjunction with what has been entered in the Host field to match incoming requests.
...
Wild cards are not allowed. To match all paths on the host, leave this field blank or choose [All] from the menu.
In the event that there are multiple proxy connections configured that could match to an incoming request, the one with the combination of best host match and longest matching path is selected, with the host match being the more heavily weighted factor. For example, suppose there was an incoming target URL of https://parabank.parasoft.com/parabank/services/bank/customers/12212
and four proxies that could match to it:
- Host:
parabank
Path:/parabank
- Host:
parabank.parasoft
Path:/parabank/services/bank/customers
- Host:
parabank.parasoft.com
Path:/parabank/services_proxy
- Host:
parabank.parasoft.com
Path:/parabank/services
In such a situation, proxy #4 would be selected because, even though #2 has the more exact Path match, #4 has the better Host match and, unlike #3, at least a partial Path match.
Anchor PrimaryAndSecondaryConnection PrimaryAndSecondaryConnection
PrimaryAndSecondaryConnection | |
PrimaryAndSecondaryConnection |
...
Service Connection (outgoing)
...
Specify the
...
URL or path to a Virtual Asset or Message Proxy for the target application
...
for both the primary and secondary connections. You can also choose to route the request to the original host requested by the client. Primary and Secondary are set up the same way:
- To specify the URL for the target application: choose Custom from the menu and enter the full URL, comprising of the service host, service port, and (optionally) forward path in the URL field. See the notes below regarding each of these components of the service URL.
- 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
, or127.0.0.1
as the service host rather than the actual hostname. When usinglocalhost
or127.0.0.1
, the service port must match the port Virtualize is deployed on; when usinghost.virt.internal
the service port is not used. For example, a virtual asset deployed onhttp://localhost:9080/myVirtualAsset
can also be reached usinghttp://host.virt.internal/myVirtualAsset
- If you want the proxy to forward to a virtual asset on the local server without consuming an HTTP connection, enter
...
- .
- Service port
...
- : This is the port to which the proxy will send messages.
...
(Optional) Enter the path to which the proxy should forward the messages that it receives. If blank, the proxy will forward messages along the original incoming path without modification.
- Forward path: If no forward path is specified, the Proxy listen path is used. If the HTTP proxy is sending messages to localhost, you must
...
- specify a
...
- forward path
...
- because the proxy doesn't allow forwarding to itself.
...
- If the
...
- 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.
- To specify the path to a Virtual Asset or Message Proxy for the target application: choose Virtualize from the menu and enter the path to the Virtual Asset or Message Proxy in the Path field.
- To route the request to the original host requested by the client, choose Passthrough from the menu.
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.
...
- Both connections: Records traffic for both the primary and secondary connections. Error messages from the active connection will not be recorded; instead, the messages will be sent to the backup connection and the responses will be recorded. Errors reported by the backup will be recorded.
- Primary connection only: Records traffic for the active connection. Does not record errors.
- Secondary connection only: Records traffic for the backup connection, including errors.
Valid HTTP response code ranges: Allows you to customize the message proxy's failover behavior so that it succeeds with HTTP response codes outside the 2xx range. Specify single codes and/or code ranges as a comma-separated list. For example, if you use "404, 500-599"
, a 404
code or any code in the 5xx
range will be accepted.
Learn responses: Enable this option if you want your internal endpoint to learn to emulate the responses recorded from a live endpoint. The internal endpoint must have a files responder (see Request Response Files for more information). This option is only available when Use other connection if selected mode fails is enabled (see above). You can easily enable/disable learning by the proxy by right-clicking the proxy and switching the mode to Enable All or Disable All.
...