1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HttpWebRequest doesn't work when fiddler is not running..

Discussion in 'C, C++, C#' started by MoneyIsTheGod, Mar 18, 2014.

  1. MoneyIsTheGod

    MoneyIsTheGod Power Member

    Joined:
    Oct 26, 2013
    Messages:
    618
    Likes Received:
    378
    Occupation:
    Software Developer
    Home Page:
    My bots didn't work when fiddler was not running, then I was running fiddler and my bots were starting to work..
    So I thought fiddler changed my pc's proxy settings and I fixed it. But "one" of my bots still doesn't work when fiddler is not running..
    Why?? But when I use proxies for my bot then it starts working again. Help me, man....
     
  2. gtownfunk

    gtownfunk Registered Member

    Joined:
    Jan 26, 2011
    Messages:
    99
    Likes Received:
    26
    Occupation:
    Software Developer
    Location:
    Austin, TX
    Home Page:
    Are they different bots that are going to/scraping different services? Is it possible that a proxy IS set globally and until it gets set for individual processes?

    #1 - Check in your IE settings for a global proxy server
    #2 - Get a copy of wireshark and see where that traffic is going

    If you have the code, step through it and see where it starts failing.

    gtownfunk
     
  3. rootjazz

    rootjazz Jr. VIP Jr. VIP

    Joined:
    Dec 21, 2012
    Messages:
    614
    Likes Received:
    313
    Occupation:
    Developer
    Location:
    UK
    Home Page:
    Check what you are doing with the HttpWebRequest.Proxy object.

    If not using it, try setting it to null. See if that works.

    But if set to null, note then fiddler won't work as you will be bypassing the fiddler proxy.

    Am sure have seen others mention this issue, best to check on stackoverflow, they probably have the solution
     
  4. Chris22

    Chris22 Regular Member

    Joined:
    Sep 29, 2010
    Messages:
    400
    Likes Received:
    1,059
    Heres a tip, explicitly setting the Proxy property to null before you call GetResponse (if you are not using a proxy that is) will speed up your web requests because it will skip the auto proxy detection.
     
  5. Daagur

    Daagur Newbie

    Joined:
    Aug 22, 2012
    Messages:
    33
    Likes Received:
    60
    Home Page:
    When starting Fiddler it sets a global proxy through which all your connections are passed. Normally Fiddler removes this global proxy when you shut it down but sometimes it just remaines there. So check your ie settings if there is a proxy set and remove it or set the proxy settings of the webrequest to null (or, what is actually better, use GlobalProxySelection.GetEmptyWebProxy(). This will return an empty webproxy which indicates that no proxy is used)
    If this isn't the issue make sure, that you properly close every webresponse you get
     
  6. akacash

    akacash Jr. VIP Jr. VIP

    Joined:
    Jan 16, 2010
    Messages:
    807
    Likes Received:
    576
    Location:
    The Beach, USA
    Unless I'm missing something here I think all you did was forget to remove the Fiddler proxy settings from your program/bot. Considering what you've told us. All apps are the same, all other apps work, and if you put private proxies in it works, or if you start Fiddler. So when you start Fiddler is basically turns your computer into a proxy server so that you can monitor all the packets being transferred in and out. When you want to sniff something you enter the "proxy" you'll be connecting with (192.168.1.*:8888). From the sounds of it, whether you hardcoded it or are entering it manually, you forgot to switch off that "proxy". That's why when Fiddler is closed it won't work, but when you open Fiddler now the proxy 192.168.1.*:8888 will connect because Fiddler is open and running in a server mode. Since your private proxies are always online they always work. I'll be willing to bet you forgot to change the proxy settings on your 1 bot. Esp if it works on private proxies, all the others work, and it works with Fiddler open.