frisby icon indicating copy to clipboard operation
frisby copied to clipboard

Unable to capture traffic through Fiddler

Open patrickisallen opened this issue 7 years ago • 2 comments

In frisby 0.8.x I was able to route all my traffic from my tests into Fiddler for further debugging using the following:

process.env.https_proxy = "http://127.0.0.1:8888"; process.env.http_proxy = "http://127.0.0.1:8888";

Now with Frisby 2.0.x I am unable to capture any traffic at all. Is there any way to set the proxy with the new implementation?

patrickisallen avatar Aug 29 '17 21:08 patrickisallen

Frisby v2.x uses the fetch API, so if there is a way to do it with that, then it can be done. I would also entertain a more direct method of doing this as well if you have other ideas.

vlucas avatar Aug 30 '17 13:08 vlucas

At the moment, the only solution I could find is through using https-proxy-agent by doing the following:

let proxy = process.env.https_proxy || 'http://127.0.0.1:8888';

frisby.get('https://testurl.com', { agent: new HttpsProxyAgent(proxy)})

alternative would be to use frisby.fetch() but both work the same. Not the most elegant solution unless there was a way to include this in my global set-up which i'm still trying to figure out.

The following works now:

frisby.globalSetup({
    request: {
      headers: {
        'cookie': someCookie
      },
      agent: new HttpsProxyAgent(proxy)
    },
   
  })

patrickisallen avatar Aug 30 '17 19:08 patrickisallen