This package contains the code for Cypress's HTTP interception proxy.
./lib/http
contains the code that intercepts HTTP requests. The bulk of the proxy's behavior is in three files:
request-middleware.ts
contains code that manipulates HTTP requests from the browserresponse-middleware.ts
contains code that manipulates HTTP responses to the browsererror-middleware.ts
handles errors that occur in the request/response cycle
Note: you should not ever need to build the .js files manually. @packages/ts
provides require-time transpilation when in development.
yarn workspace @packages/proxy build-prod
Tests are located in ./test
To run tests:
yarn workspace @packages/proxy test
Additionally, the server
package contains tests that use the proxy
.
High level logs are available in the DEBUG=cypress:proxy:*
namespace.
Detailed per-request logs are available in DEBUG=cypress-verbose:proxy:http
.