Configuring a HTTP(S) reverse proxy or TCP port forwarding
The reverse proxy capability allows applications that are unable to configure HTTP(S) forward proxying to address the proxy directly and have it forward these requests to a configured destination, which is also applicable for forwarding TCP-based communications.
Note: For
an explanation of when to use a reverse proxy versus a standard proxy,
see Virtualizing HTTP.
About this task
Procedure
- Find the destination URI used by the client.
- Using any text editor, open the registration.xml file that is available in RTCP_installation_directory/httptcp location.
- In the registration.xml file, add
the TCP forward rule for the destination URI and specify the proxy
port for recording the HTTP or HTTPS traffic for the client.
- Example of TCP forward rule for HTTP:
<forward bind ="198.51.100.1:3333" destination ="www.example.com:80" type="http"/>
- Example of TCP forward rule for HTTPS:
<forward bind ="198.51.100.1:3334" destination ="www.example.com:443" type="https"/>
- Example of TCP forward rule for TCP:
<forward bind ="198.51.100.1:3333" destination ="www.example.com:80"/>
Note: The host name or the IP address that is specified for the bind attribute determines which network interface the proxy listens on.- IP address: Binds to the specified adapter
- 0.0.0.0: Binds to all the addresses/adapters on the machine. Specify this value if you do not know the specific hostname or IP that the machine is listening on
- localhost: Allows connections only from the local machine
Note:type
attribute values that are available for TCP-based transports are listed in the comments in the registration.xml file for the proxy. Those values include:ims
,imsconnect
,ipic
, andmqtt
. - Example of TCP forward rule for HTTP:
- Optional: If your destination URI uses HTTPS,
but you want to configure your client to send its traffic to the proxy
without encryption (that is, through plain HTTP) then use an HTTP
to HTTPS forward rule. The proxy then directs the HTTP traffic that
arrives on a specific port to the final HTTPS destination. In the registration.xml file,
add the HTTP to HTTPS forward rule for the destination URI, specify
the proxy port for recording the HTTP traffic for the client and specify
the destination type to be HTTPS.
- Example of HTTP to HTTPS forward rule:
<forward bind ="localhost:2000" destination ="www.example.com:443" type="http" destinationType="https"/>
This example shows a plain text connection to localhost port 2000 to relay traffic to the secure example site.
- Example of HTTP to HTTPS forward rule:
- In the registration.xml file, set
the
disableConnectForwarding
attribute value to"true"
. - Configure the client to use the defined proxy host and the port as the final destination.
- Restart the proxy. See Starting and stopping the HTTP/TCP proxy.