Gathering detailed insights and metrics for @mocks-server/plugin-proxy
Gathering detailed insights and metrics for @mocks-server/plugin-proxy
Gathering detailed insights and metrics for @mocks-server/plugin-proxy
Gathering detailed insights and metrics for @mocks-server/plugin-proxy
Node.js mock server running live, interactive mocks in place of real APIs
npm install @mocks-server/plugin-proxy
Typescript
Module System
Min. Node Version
Node Version
NPM Version
Improve typings
Updated on Jun 06, 2023
Support openapi example property
Updated on May 29, 2023
Config: support nullable arrays and objects
Updated on May 25, 2023
Fix plugins peerDependencies
Updated on May 24, 2023
Migrating to TypeScript
Updated on May 23, 2023
Fix OpenAPI paths with multiple params
Updated on Apr 09, 2023
JavaScript (94.13%)
TypeScript (4.66%)
HTML (0.62%)
Handlebars (0.3%)
CSS (0.22%)
Shell (0.06%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
304 Stars
4,048 Commits
18 Forks
3 Watchers
6 Branches
4 Contributors
Updated on Jun 30, 2025
Latest Version
4.0.0
Package Id
@mocks-server/plugin-proxy@4.0.0
Unpacked Size
15.74 kB
Size
3.65 kB
File Count
6
NPM Version
8.15.0
Node Version
16.17.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
1
1
Plugin for Mocks Server that provides a variant handler that proxy requests to another host and pass response back to original caller.
It uses the express-http-proxy package under the hood, and supports all of its options.
Important: From v3.0.0, this plugin includes two route handlers:
proxy
andproxy-v4
. This was made to allow Mocks Server v3 users to progressively adapt their code to Mocks Server v4 without breaking changes. It is strongly recommended to use theproxy-v4
handler. In the next major release, backward compatibilty will be removed and theproxy
handler will be replaced byproxy-v4
.
proxy-v4
handlerThis plugin is included in the main distribution of the Mocks Server project, so you can also read the official documentation website.
If you want a route variant to use the proxy-v4
handler, define its handler
property as "proxy-v4". Use the host
property to set the host for the route, and the options
property to set any of the express-http-proxy options.
1module.exports = [ 2 { 3 id: "proxy-all", 4 url: "*", 5 method: ["GET", "POST", "PATCH", "PUT"], 6 variants: [ 7 { 8 id: "proxy-to-google", 9 type: "proxy-v4", // This route variant will use the "proxy" handler from this plugin 10 options: { 11 host: "https://www.google.com", // proxy host 12 options: {}, // Options for express-http-proxy 13 }, 14 }, 15 ], 16 }, 17];
Here are listed the specific properties that can be defined in a proxy-v4
route variant. They must be defined in the options
property of the variant:
host
(String|Function): The proxy host. Equivalent to the express-http-proxy
host
option, so it can also be a function.options
(Object): Object containing any of the options supported by the express-http-proxy
package. Some of them are:
filter
option for express-http-proxy
.userResDecorator
option for express-http-proxy
.express-http-proxy
options are also supported.Tip: Note that the variant
delay
option is still valid for routes handled by this plugin, so you can use it to simulate that host responses are slow.
proxy
handlerIf you want a Mocks Server v3 route variant to use the proxy
handler, define its type
property as "proxy". Use the host
property to set the host for the route, and the options
property to set any of the express-http-proxy options.
1module.exports = [ 2 { 3 id: "proxy-all", 4 url: "*", 5 method: ["GET", "POST", "PATCH", "PUT"], 6 variants: [ 7 { 8 id: "proxy-to-google", 9 type: "proxy", // This route variant will use the "proxy" handler from this plugin 10 host: "https://www.google.com", // proxy host 11 options: {}, // Options for express-http-proxy 12 }, 13 ], 14 }, 15];
Mocks server common properties to all route handlers are in cursive. Specific properties of this plugin are in bold:
host
(String|Function): The proxy host. Equivalent to the express-http-proxy
host
option, so it can also be a function.options
(Object): Object containing any of the options supported by the express-http-proxy
package. Some of them are:
filter
option for express-http-proxy
.userResDecorator
option for express-http-proxy
.express-http-proxy
options are also supported.Tip: Note that the
delay
option is still valid for routes handled by this plugin, so you can use it to simulate that host responses are slow.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/13 approved changesets -- score normalized to 0
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
75 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More