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

Capturing web traffic from my .NET application

3 Answers 1195 Views
Windows
This is a migrated thread and some comments may be shown as answers.
Youssef
Top achievements
Rank 1
Youssef asked on 11 Aug 2017, 07:54 PM
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

3 Answers, 1 is accepted

Sort by
0
Tsviatko Yovtchev
Telerik team
answered on 16 Aug 2017, 11:11 AM
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
0
Youssef
Top achievements
Rank 1
answered on 16 Aug 2017, 06:19 PM
[quote]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
[/quote]

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 ?
0
Alexander
Telerik team
answered on 21 Aug 2017, 05:00 PM
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
Tags
Windows
Asked by
Youssef
Top achievements
Rank 1
Answers by
Tsviatko Yovtchev
Telerik team
Youssef
Top achievements
Rank 1
Alexander
Telerik team
Share this question
or