The Problem
To help debug and monitor http request between the java application and the remote server, I configure Fiddler in machineA as a reverse proxy which forwards request to http://machineA:8888 to http://remoteServer:8080. This is easy: follow the guide: Use Fiddler as a Reverse Proxy
Ensure Allow remote clients to connect is checked.
Click Rules > Customize Rules, Inside the OnBeforeRequest handler*, add a new line of code:
static function OnBeforeRequest(oSession: Session) {
if (oSession.host.toLowerCase() == "machineA:8888")
{
oSession.host = "remoteServer:8080";
}
But today, I need pointer to one remote server which uses https: https://remoteServerB.
The Solution
The solution is almost same as http reverse proxy, we just need change http to https additionally.
Click Rules > Customize Rules, Inside the OnBeforeRequest handler, add a new line of code:
static function OnBeforeRequest(oSession: Session) {
if (oSession.host.toLowerCase() == "machineA:8888")
{
oSession.host = "remoteServerB";
oSession.oRequest.headers.UriScheme = "https";
}
One additional bonus is that due to the additional proxy layer, the complexity of https protocol, such as https handshake is hidden. We can raw decrypted request and response between the application and remote https://remoteServerB.
Resource
Use Fiddler as a Reverse Proxy
To help debug and monitor http request between the java application and the remote server, I configure Fiddler in machineA as a reverse proxy which forwards request to http://machineA:8888 to http://remoteServer:8080. This is easy: follow the guide: Use Fiddler as a Reverse Proxy
Ensure Allow remote clients to connect is checked.
Click Rules > Customize Rules, Inside the OnBeforeRequest handler*, add a new line of code:
static function OnBeforeRequest(oSession: Session) {
if (oSession.host.toLowerCase() == "machineA:8888")
{
oSession.host = "remoteServer:8080";
}
But today, I need pointer to one remote server which uses https: https://remoteServerB.
The Solution
The solution is almost same as http reverse proxy, we just need change http to https additionally.
Click Rules > Customize Rules, Inside the OnBeforeRequest handler, add a new line of code:
static function OnBeforeRequest(oSession: Session) {
if (oSession.host.toLowerCase() == "machineA:8888")
{
oSession.host = "remoteServerB";
oSession.oRequest.headers.UriScheme = "https";
}
One additional bonus is that due to the additional proxy layer, the complexity of https protocol, such as https handshake is hidden. We can raw decrypted request and response between the application and remote https://remoteServerB.
Resource
Use Fiddler as a Reverse Proxy