Unable to capture traffic from a C++ winsock2 application

890 views
Skip to first unread message

Sander Smid

unread,
Sep 27, 2013, 5:05:21 AM9/27/13
to httpf...@googlegroups.com
Hi,

First of all thanks for this very useful tool. We've been building our own client/server setup and it has proven to be a valuable asset in our development pipeline. We've build a restful server using C# WCF. Our clients are developed in several languages and most work fine. But for some reason I can't seem to capture any traffic from our Win32 C++ application using winsock2.

I noticed the request for answering these questions below so here we go.

   1. On Fiddler’s Help menu, click Troubleshoot Filters and navigate your browser somewhere. Does traffic appear in Fiddler?
   2. In your browser, visit http://ipv4.fiddler:8888/. Does anything appear in Fiddler or your browser?
   3. In your browser, visit http://localhost:8888/. Does anything appear in Fiddler or your browser?


All the steps above work and I can send and inspect traffic using fiddler when the requests come from the browser (or a C# client).

I looked at the troubleshooting documentation about the subject but none of the three options resolved the issue. Below a quick recap on the suggested solutions.

Solution 1: Use Machine Name or Hostname
This does not work when I'm running our server in the Visual Studio Development Server (VS2012) which seem to bind to localhost.
Solution 2: Use http://ipv4.fiddler
I haven't been able to resolve the ipv4.fiddler address using 'getaddrinfo' (from WS2tcpip.h)
Solution 3: Updated Rules File
Nothing changed.

Some additional information:
- Initially I started with the latest version of Fiddler v2 but changed, guessing it might be related to the fiddler version, to the latest release of version 4 (v4.4.5.3 - 64-bit AMD64) on Windows 8.
- Using rawcap I've been able to capture localhost traffic which can be inspected with Wireshark, thus far I did not notice anything special.
- Connecting to a random other server (e.g. google.com) from our C++ application does not show up on fiddler either.
- Switching from "using system proxy" to "no proxy" in firefox results in the same behaviour as our C++ application. Networking works but does not show up in fiddler. Can I force applications to use the "system proxy"?

Perhaps I'm missing obvious, I really do hope so.
I'm looking forward to your replies.

Thanks in advance,
Sander

EricLaw

unread,
Sep 27, 2013, 9:52:47 AM9/27/13
to
WinSock implements TCP/IP, not HTTP.

If your client is for some reason implementing HTTP on top of WinSock instead of using either of the two HTTP stacks in Windows (WinHTTP/WinINET) then that implementation needs to be updated to support HTTP proxies in order to work with Fiddler (and with the many corporate networks that require a proxy).
Reply all
Reply to author
Forward
0 new messages