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

4 posts, 0 answers
  1. Neil
    Neil avatar
    3 posts
    Member since:
    Oct 2019

    Posted 23 Oct 2019 Link to this post

    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.

     

     

  2. Neil
    Neil avatar
    3 posts
    Member since:
    Oct 2019

    Posted 23 Oct 2019 Link to this post

    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

     

  3. Simeon
    Admin
    Simeon avatar
    242 posts

    Posted 24 Oct 2019 Link to this post

    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
  4. Neil
    Neil avatar
    3 posts
    Member since:
    Oct 2019

    Posted 25 Oct 2019 in reply to Simeon Link to this post

    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.

Back to Top