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

FiddlerCore not capturing traffic from remote client. (My iOS phone)

0 Answers 135 Views
Windows
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 13 Apr 2016, 11:08 AM

Here's my application's code:

public partial class frmMain : Form
    {
        private KeyValuePair<string, string>[] EncodeKeys =
        {
            new KeyValuePair<string, string>("MfZyu1q9", "EmcshnQoDr20TZz1")
        };
        public frmMain()
        {
            InitializeComponent();
        }
 
        public static bool InstallCertificate()
        {
            if (!CertMaker.rootCertExists())
            {
                if (!CertMaker.createRootCert())
                    return false;
 
                if (!CertMaker.trustRootCert())
                    return false;
            }
 
            return true;
        }
 
        private void frmMain_Load(object sender, EventArgs e)
        {
            if (!InstallCertificate())
                MessageBox.Show("Failed to install certificate.");
            try
            {
                FiddlerApplication.BeforeRequest += FiddlerApplication_BeforeRequest;
                FiddlerApplication.BeforeResponse += FiddlerApplication_BeforeResponse;
                //FiddlerApplication.AfterSessionComplete += FiddlerApplication_AfterSessionComplete;
                FiddlerApplication.Startup(8888, true, true, true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 
        void FiddlerApplication_BeforeRequest(Session oSession)
        {
            if (oSession.RequestMethod == "CONNECT")
                return;
            oSession.bBufferResponse = true;
        }
 
        void FiddlerApplication_BeforeResponse(Session oSession)
        {
            if (oSession.RequestMethod == "CONNECT")
                return;
            try
            {
                //if (oSession.uriContains("action"))
                //{
                    oSession.utilDecodeResponse();
                    Debug.Print(oSession.GetResponseBodyAsString());
                //}
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }

 

Now this all works on my home computer when I connect remotely, it captures traffic just fine. However, on my work computer which I am using right now it does not work.

This isn't a firewall issue, because when I open the Fiddler application, it captures the remote traffic just as it's supposed to within my program.

I set my iPhone to connect to the proxy, and whenever I go to load a page, it just doesn't load and gives me "Safari could not open the page because the server stopped responding."

No answers yet. Maybe you can help?

Tags
Windows
Asked by
Ryan
Top achievements
Rank 1
Share this question
or