Capturing web traffic from my .NET application

4 posts, 0 answers
  1. Youssef
    Youssef avatar
    3 posts
    Member since:
    May 2015

    Posted 11 Aug 2017 Link to this post

    Hello,
    I've got problem with capturing web request sent from my VB.NET ( I think if C# it will be the same ).
    If I sent the request without any proxy settings, Fiddler captures it.
    If I sent the request with proxy settings even if it's blank settings, Fiddler doesn't captures it.

    Here is VB.NET Code which sends a google search request with blank proxy settings.

        Private Sub searchGoogle(ByVal q As String)
            Dim req As HttpWebRequest = WebRequest.Create("https://www.google.com/search?q=" & q)
            req.Proxy = New WebProxy()
            Using res = req.GetResponse()
                Using resStrm = res.GetResponseStream()
                    Using rdr As New StreamReader(resStrm)
                        rdr.ReadToEnd()
                    End Using
                End Using
            End Using
        End Sub
  2. Tsviatko Yovtchev
    Admin
    Tsviatko Yovtchev avatar
    549 posts

    Posted 16 Aug 2017 Link to this post

    Fiddler is a proxy itself. It sets itself as system proxy and that's how it gets traffic. Your code effectively changes the proxy settings and traffic does not get proxied through Fiddler any more.
    Regards,
    Tsviatko Yovtchev
    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
  3. Youssef
    Youssef avatar
    3 posts
    Member since:
    May 2015

    Posted 16 Aug 2017 in reply to Tsviatko Yovtchev Link to this post

    Tsviatko Yovtchev said:Fiddler is a proxy itself. It sets itself as system proxy and that's how it gets traffic. Your code effectively changes the proxy settings and traffic does not get proxied through Fiddler any more.
    Regards,
    Tsviatko Yovtchev
    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


    Thanks for your reply !

    If I set HttpWebRequest.Proxy to New WebProxy(), What is the settings of proxy is being used here in my request so I can put this proxy settings into fiddler ?
  4. Alexander
    Admin
    Alexander avatar
    336 posts

    Posted 21 Aug 2017 Link to this post

    Hi,

    Not setting the Proxy property of the HttpWebRequest at all should do the job. This way it will use the machine proxy settings, which should point to Fiddler.

    Regards,
    Alexander
    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
Back to Top