Questions tagged [mockttp]

This tag is for questions related to Mockttp (github.com/httptoolkit/mockttp) an open-source proxy library that is part of HTTP Toolkit (httptoolkit.com). You can use this tag both for issues purely related to the Mockttp itself, and for networking issues with other tools/languages that you're using Mockttp to test or intercept. The 'http-toolkit' tag may also be relevant in some cases.

Mockttp is an open-source JavaScript library that allows you to intercept HTTP & HTTPS traffic and easily define how it should be handled: proxying requests, injecting responses, monitoring traffic, or anything else you like.

Mockttp is battle-tested as the internal proxy that powers HTTP Toolkit, an open-source HTTP debugging tool.

For more information, take a look at the README or follow the getting started guide.

7 questions
1
vote
1 answer

Unable to run mockttp with Cypress

I'm trying to run the mockttp with cypress. I used the example that's listed in project github. I changed the port to run on 3000 but I am getting an error saying Cannot add rules before the server is started. /*global cy:true,before:true*/ ///…
cccap1550
  • 23
  • 4
1
vote
1 answer

Why are only top-level requests proxied when configuring http clients such as postman or K6

The Goal Run integration tests but stub sub-requests to a specific domain that occur within the API code itself Ideally, do this via docker-compose because I want to be able to run this in Circle CI or Jenkins The attempt I'm using the mockttp…
punkrockbuddyholly
  • 9,675
  • 7
  • 36
  • 69
0
votes
0 answers

Is there any way to forward to an absolute path using thenForwardTo()? as it only accepts hostname without path

I want to forward requests to a particular path but I am not able to do it using thenForwardTo(). It is throwing error and it only accepts hostname (without path). For example, I want to match one absolute URL & forward it to another absolute URL…
Rivu
  • 1
  • 3
0
votes
0 answers

How to handle "Passthrough loop detected" requests in mockttp

I have set up mockttp to intercept HTTPS requests and do some logging, with a rule like this: import * as mockttp from 'mockttp' const https = await mockttp.generateCACertificate() const caFingerprint =…
joshden
  • 692
  • 10
  • 16
0
votes
1 answer

Trying to Inject a JavaScript into webpage using mockttp

So far i have tried the below code but its throwing me an error Failed to handle request: Cannot read properties of undefined (reading 'replace') var INJECT = "" await…
0
votes
0 answers

proxy-authentication header missing with https

I want to create a mitm proxy that can only be access by providing correct credentials: (async () => { const mockttp = require('mockttp'); // Create a proxy server with a self-signed HTTPS CA certificate: const https = await…
maddo7
  • 4,503
  • 6
  • 31
  • 51
0
votes
1 answer

how can i update UI to show "WebRTC data channel" at match section in use by httptoolkit-server?

enter image description hereI've installed all httptoolkit-server and also the httptoolkit-ui to capture data and mock it up, i've installed mockrt,mockttp,docker,... plugin's too but i cant see "WebRTC data channel" in the match section like the…