Installations
npm install mocking-cors-proxy
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.16.2
NPM Version
6.14.4
Score
52.6
Supply Chain
82.8
Quality
75
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (99.08%)
Shell (0.72%)
JavaScript (0.2%)
validate.email 🚀
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Developer
e-hein
Download Statistics
Total Downloads
398
Last Day
1
Last Week
2
Last Month
10
Last Year
71
GitHub Statistics
42 Commits
2 Watchers
1 Branches
1 Contributors
Updated on May 08, 2020
Package Meta Information
Latest Version
0.0.2
Package Id
mocking-cors-proxy@0.0.2
Unpacked Size
5.19 kB
Size
2.14 kB
File Count
3
NPM Version
6.14.4
Node Version
10.16.2
Total Downloads
Cumulative downloads
Total Downloads
398
Last Day
0%
1
Compared to previous day
Last Week
0%
2
Compared to previous week
Last Month
-16.7%
10
Compared to previous month
Last Year
1.4%
71
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Mocking Cors Proxy
That's an development util - do never use for productive systems!
Quickstart
1npm i -g mocking-cors-proxy 2mocking-cors-proxy --help 3> Usage: mocking-cors-proxy [options] 4> 5> Options: 6> -V, --version output the version number 7> -m, --map <...path to target> statically map an endpoint to real targets 8> -p, --port <port> start on alternative port (default is 2345) 9> -c, --config <configJson> use config file 10> -h, --help output usage information 11mocking-cors-proxy 12> (running)
- should forward http://localhost:2345/http/www.example.com/index.html to http://www.example.com/index.html and add cors headers to the response.
- should forward http://localhost:2345/https/www.example.com/index.html to https://www.example.com/index.html and add cors headers to the response.
- should forward http://localhost:2345/http/localhost:4200/app to http://localhost:4200/app so your local app and the google api seems to be on the same host and CORS security is disabled completely.
- there's a test page at http://localhost:2345/mocking-cors-proxy-test that shows you wheter the proxy is alive and known pathes.
Intent
During development of web pages it's often useful to be able to run a local dev version with a staged central dev backend. You should not send valid CORS-Responses for localhost from every stage of your backend but while this improves security (a bit) it can lead to much harder development setups. So this proxy helps you to destroy this bit of additional security ;-)
Warning: It's not intended to use this software deployed on a central (dev-)server. There's no security and it can help people to hide their true identity while doing eval things!
Command line interface
With the command line interface you can configure the port and some static rules without writing a config file.
Example:
1npm i -g mocking-cors-proxy 2mocking-cors-proxy --port 8080 \ 3 --map "/app/ to http://localhost:4200" \ 4 --map "/app2 to http://localhost:4200/app/" 5> (running)
- should forward http://localhost:8080/app/ to http://localhost:4200/app/
- should forward http://localhost:8080/app2/ to http://localhost:4200/app/ (2nd source does not end with '/' so path is replaced)
- should also do defaults (see above) at port 8080
Config File
Using a config file, you will get more settings and reusable configurations.
Complete schema of the config can be found at: ./lib/config.schema.json
Example:
1{ 2 "port": 8081, 3 "host": "0.0.0.0", 4 "accessControl": { 5 "methods": [ 6 "GET", "HEAD", "PUT", "PATCH", "POST", "DELETE" 7 ], 8 "maxAge": 10, 9 "requestHeaders": [ 10 "Authorization", "X-Custom-Header" 11 ] 12 }, 13 "staticRoutes": [ 14 { "from": "/app/", "to": "http://localhost:4200" }, 15 { "from": "/app2", "to": "http://localhost:4200/app/" }, 16 { "from": "/rest", "to": "http://localhost:3000/rest/" } 17 ] 18}
- should forward http://localhost:8081/app/ to http://localhost:4200/app/
- should forward http://localhost:8081/app2/ to http://localhost:4200/app/ (2nd source does not end with '/' so path is replaced)
- should also do defaults (see above) at port 8081
Usage:
1npm i -g mocking-cors-proxy 2mocking-cors-proxy -c my-mocking-cors-proxy.conf.json 3> (running)

No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
2.6
/10
Last Scanned on 2025-02-24
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