This is a migrated thread and some comments may be shown as answers.

No traffic seen from VS 2017 HTTP Client app in Fiddler ?

3 Answers 5902 Views
Windows
This is a migrated thread and some comments may be shown as answers.
Neil
Top achievements
Rank 1
Neil asked on 23 Oct 2019, 11:37 AM

I trying to test a simple demo application written in Visual Studio C++. However nothing is logged in Fiddler 4 when the program runs.

I complied the code from here on my Win10 m/c using VS 2017 community:

https://www.codeproject.com/Articles/66625/A-Fully-Featured-Windows-HTTP-Wrapper-in-C

I am running this simple function which does a 'GET'

void SimpleGetTest(void)
{
    wprintf(L"SimpleGetTest\r\n");

    // Set URL.
    WinHttpClient client(L"http://www.codeproject.com/");

    // Send http request, a GET request by default.
    client.SendHttpRequest();

    // The response header.
    wstring httpResponseHeader = client.GetResponseHeader();

    // The response content.
    wstring httpResponseContent = client.GetResponseContent();

    wprintf(L"<%ws>\r\n", httpResponseContent.c_str());
}

 

When I run the program the console output shows HTML response content just fine, Fiddler sees nothing.

 

If I stick "http://www.codeproject.com/" into my Firefox Fiddler does see the traffic ok.

 

I am very new to Fiddler and I downloaded it a few days ago and I am using it with the default settings. Is there some setting I need to change so it sees the traffic from my code?

 

As a matter of interest when I start VS Studio I can see traffic in Fiddler for the connection to Microsoft VS site.

 

 

3 Answers, 1 is accepted

Sort by
0
Neil
Top achievements
Rank 1
answered on 23 Oct 2019, 12:00 PM

I think I found the answer in this reply :

Hi Sristi,

Please, try these commands:
The command you should use is "netsh winhttp set proxy 127.0.0.1:8888". Also do not forget to clear the proxy back when you turn off Fiddler - "netsh winhttp reset proxy". You can check the current proxy settings by "netsh winhttp show proxy"

Regards,
Simeon
Progress Telerik

https://www.telerik.com/forums/fiddler-no-longer-capturing-web-service-requests-in-net#Na1DRSrPFEWB7OSxBrDGgw

 

0
Simeon
Telerik team
answered on 24 Oct 2019, 03:02 PM

Hi Neli,

Did using the netsh winhttp set proxy command solved your problem?

Another approach you could try is setting a proxy on the WinHttpClient instance:

client.SetProxy(L"127.0.0.1:8888");

Regards,
Simeon
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Neil
Top achievements
Rank 1
answered on 25 Oct 2019, 07:10 AM

Yes using "netsh winhttp set proxy 127.0.0.1:8888" did work, so I can now see the http transactions my application is doing. I had run the 'cmd' as administrator for it to work.

I will try adding a call to "client.SetProxy(L"127.0.0.1:8888");" to see if  that works.

Tags
Windows
Asked by
Neil
Top achievements
Rank 1
Answers by
Neil
Top achievements
Rank 1
Simeon
Telerik team
Share this question
or