Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable to capture traffic through Fiddler #389

Open
patrickisallen opened this issue Aug 29, 2017 · 2 comments
Open

Unable to capture traffic through Fiddler #389

patrickisallen opened this issue Aug 29, 2017 · 2 comments

Comments

@patrickisallen
Copy link

patrickisallen commented Aug 29, 2017

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?

@vlucas
Copy link
Owner

vlucas commented Aug 30, 2017

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.

@patrickisallen
Copy link
Author

patrickisallen commented Aug 30, 2017

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)
    },
   
  })

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants