408 errors when using Fiddler as reverse proxy

512 views
Skip to first unread message

Julia Nol

unread,
Oct 19, 2015, 12:18:24 PM10/19/15
to Fiddler

Hi!
I try to start using fiddler core for capturing http requests from IIS server to mobile applications in automated tests. In my mind it should not impact performance much but after we set up reverse proxy i often get 408 error in my mobile client during test execution.
Can you help me? I use such code:
           
            FiddlerApplication.BeforeRequest += delegate(Session oS)
           
{
                oS
.bBufferResponse = false;
               
Monitor.Enter(oAllSessions);
                oAllSessions
.Add(oS);
               
Monitor.Exit(oAllSessions);
                oS
["X-AutoAuth"] = "(default)";
               
               
if (string.Equals(oS.hostname, sSecureEndpointHostname, StringComparison.OrdinalIgnoreCase) && oS.port == iPort)
               
{
                    oS
.port = 80;
               
}
                FiddlerApplication.Prefs.SetBoolPref("fiddler.network.streaming.abortifclientaborts", true);
                FiddlerApplication.Prefs.SetInt32Pref("fiddler.network.timeouts.clientpipe.receive.initial", 300010);
                FiddlerApplication.Prefs.SetInt32Pref("fiddler.network.timeouts.clientpipe.receive.reuse", 300010);
                FiddlerCoreStartupFlags oFCSF = FiddlerCoreStartupFlags.None;
                oFCSF = (oFCSF | FiddlerCoreStartupFlags.AllowRemoteClients |
                         FiddlerCoreStartupFlags.MonitorAllConnections |
                         FiddlerCoreStartupFlags.CaptureLocalhostTraffic);

                FiddlerApplication.Startup(port, oFCSF);
            }


May be some parameters set up wrong?

EricLaw

unread,
Oct 19, 2015, 3:53:34 PM10/19/15
to Fiddler
The code you're showing here creates a new FiddlerCore proxy instance every time a FiddlerCore instance receives a network request. Is that really what you're trying to do?

Julia Nol

unread,
Oct 20, 2015, 3:16:25 AM10/20/15
to Fiddler
Oh, its my copy-paste mistake, i'm sorry!
Brace for ending  BeforeRequest should be in another place. Here is corrected piece of code:

 FiddlerApplication.BeforeRequest += delegate(Session oS)
           
{
                oS
.bBufferResponse = false;

               
Monitor.Enter(allSessions);
                allSessions
.Add(oS);
               
Monitor.Exit(allSessions);
                oS
["X-AutoAuth"] = "(default)";
               
if (string.Equals(oS.hostname, Hostname, StringComparison.OrdinalIgnoreCase) && oS.port == port)
               
{
                    oS
.port = 80;
               
}
           
};
 CONFIG
.IgnoreServerCertErrors = false;
 
FiddlerApplication.Prefs.SetBoolPref("fiddler.network.streaming.abortifclientaborts", true);
 
FiddlerApplication.Prefs.SetInt32Pref("fiddler.network.timeouts.clientpipe.receive.initial", 300000);
 
FiddlerApplication.Prefs.SetInt32Pref("fiddler.network.timeouts.clientpipe.receive.reuse", 300000);

EricLaw

unread,
Oct 22, 2015, 11:25:59 AM10/22/15
to Fiddler
Does the HTTP/408 in the client have any explanatory text (e.g. is it coming from the server, Fiddler, or the client itself)?

How many requests is your reverse proxy receiving per second? 

Is your reverse proxy serving only HTTP requests or HTTPS as well?

Do you keep any timings to determine how long the failing requests take before they fail?

Julia Nol

unread,
Nov 20, 2015, 10:50:22 AM11/20/15
to Fiddler
Sorry for a long response.
The error text that appears on the client (android app) is only "Server Error (408)".
Each test uses its own site so number of requests per second is not very big (<1). Response bodies are rather small, in average about 3-6 kB

I capture only HTTP requests.
About 5-8 seconds passes for such failed requests.

EricLaw

unread,
Nov 20, 2015, 1:46:12 PM11/20/15
to Fiddler
So it sounds like maybe the client is hardcoded with a short timeout (e.g. 5 seconds) for handling responses. How long does the server take to return a response (e.g. look at the timers on the Session object in FiddlerCore).

Julia Nol

unread,
Nov 24, 2015, 8:25:46 AM11/24/15
to Fiddler
Here you can see session info for several typical requests/responses that i executed:

SESSION STATE: Done.
Response Entity Size: 3783 bytes.
== FLAGS ==================
BitFlags: [ClientPipeReused, ServerPipeReused] 0x18
X-CLIENTIP: ::ffff:192.168.2.130
X-CLIENTPORT: 49843
X-EGRESSPORT: 61816
X-HOSTIP: fe80::d0e1:1305:3a92:24b0%12
X-RESPONSEBODYTRANSFERLENGTH: 3,783
X-SERVERSOCKET: REUSE ServerPipe#2
== TIMING INFO ============
ClientConnected: 13:16:06.233
ClientBeginRequest: 13:16:10.367
GotRequestHeaders: 13:16:10.367
ClientDoneRequest: 13:16:10.367
Determine Gateway: 0ms
DNS Lookup: 0ms
TCP/IP Connect: 0ms
HTTPS Handshake: 0ms
ServerConnected: 13:16:06.233
FiddlerBeginRequest: 13:16:10.367
ServerGotRequest: 13:16:10.367
ServerBeginResponse: 13:16:18.646
GotResponseHeaders: 13:16:18.646
ServerDoneResponse: 13:16:18.646
ClientBeginResponse: 13:16:18.646
ClientDoneResponse: 13:16:18.646
Overall Elapsed: 0:00:08.279
The response was buffered before delivery to the client.

SESSION STATE: Done.
Response Entity Size: 2528 bytes.
== FLAGS ==================
BitFlags: [ClientPipeReused, ServerPipeReused] 0x18
X-CLIENTIP: ::ffff:192.168.2.130
X-CLIENTPORT: 49843
X-EGRESSPORT: 61816
X-HOSTIP: fe80::d0e1:1305:3a92:24b0%12
X-RESPONSEBODYTRANSFERLENGTH: 2,528
X-SERVERSOCKET: REUSE ServerPipe#2
== TIMING INFO ============
ClientConnected: 13:16:06.233
ClientBeginRequest: 13:18:50.083
GotRequestHeaders: 13:18:50.083
ClientDoneRequest: 13:18:50.083
Determine Gateway: 0ms
DNS Lookup: 0ms
TCP/IP Connect: 0ms
HTTPS Handshake: 0ms
ServerConnected: 13:16:06.233
FiddlerBeginRequest: 13:18:50.083
ServerGotRequest: 13:18:50.083
ServerBeginResponse: 13:18:51.019
GotResponseHeaders: 13:18:51.019
ServerDoneResponse: 13:18:51.019
ClientBeginResponse: 13:18:51.019
ClientDoneResponse: 13:18:51.019
Overall Elapsed: 0:00:00.935

SESSION STATE: Done.
Response Entity Size: 6711 bytes.
== FLAGS ==================
BitFlags: [ClientPipeReused, ServerPipeReused] 0x18
X-CLIENTIP: ::ffff:192.168.2.130
X-CLIENTPORT: 49939
X-EGRESSPORT: 61824
X-HOSTIP: fe80::d0e1:1305:3a92:24b0%12
X-RESPONSEBODYTRANSFERLENGTH: 6,711
X-SERVERSOCKET: REUSE ServerPipe#39
== TIMING INFO ============
ClientConnected: 13:22:34.469
ClientBeginRequest: 13:22:58.660
GotRequestHeaders: 13:22:58.660
ClientDoneRequest: 13:22:58.660
Determine Gateway: 0ms
DNS Lookup: 0ms
TCP/IP Connect: 0ms
HTTPS Handshake: 0ms
ServerConnected: 13:22:34.484
FiddlerBeginRequest: 13:22:58.660
ServerGotRequest: 13:22:58.660
ServerBeginResponse: 13:23:01.295
GotResponseHeaders: 13:23:01.295
ServerDoneResponse: 13:23:01.295
ClientBeginResponse: 13:23:01.295
ClientDoneResponse: 13:23:01.295
Overall Elapsed: 0:00:02.634



EricLaw

unread,
Dec 3, 2015, 1:47:18 PM12/3/15
to Fiddler
These show a server time of 8 seconds, 1 second, and 3 seconds which is a pretty broad range.

Just to be clear, do you see the same HTTP/408 errors when you're capturing with Fiddler itself (and not your FiddlerCore app)?

Also, you should probably include FiddlerCoreStartupFlags.OptimizeThreadPool in the flags that you pass to the Startup method.
Reply all
Reply to author
Forward
0 new messages