Comparing version 0.3.4 to 0.3.5
@@ -7,2 +7,3 @@ module.exports = [ | ||
'content-type', | ||
'time-threshold', | ||
'response-body', | ||
@@ -9,0 +10,0 @@ 'response-status', |
{ | ||
"name": "toxy", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "Hackable HTTP proxy to simulate server failure scenarios and unexpected network conditions", | ||
@@ -29,3 +29,6 @@ "repository": "h2non/toxy", | ||
"latency", | ||
"jitter" | ||
"jitter", | ||
"failover", | ||
"distributed", | ||
"soa" | ||
], | ||
@@ -32,0 +35,0 @@ "engines": { |
@@ -45,2 +45,3 @@ # toxy [![Build Status](https://api.travis-ci.org/h2non/toxy.svg?branch=master&style=flat)](https://travis-ci.org/h2non/toxy) [![Code Climate](https://codeclimate.com/github/h2non/toxy/badges/gpa.svg)](https://codeclimate.com/github/h2non/toxy) [![NPM](https://img.shields.io/npm/v/toxy.svg)](https://www.npmjs.org/package/toxy) | ||
- [Probability](#probability) | ||
- [Time threshold](#time-threshold) | ||
- [Method](#method) | ||
@@ -185,2 +186,3 @@ - [Content Type](#content-type) | ||
.withRule(rules.method('GET')) | ||
.withRule(rules.timeThreshold({ duration: 1000, threshold: 1000 * 10 })) | ||
.withRule(rules.responseStatus({ range: [ 200, 400 ] })) | ||
@@ -615,2 +617,29 @@ | ||
#### Time threshold | ||
<table> | ||
<tr> | ||
<td><b>Name</b></td><td>timeThreshold</td> | ||
</tr> | ||
<tr> | ||
<td><b>Poison Phase</b></td><td>incoming / outgoing</td> | ||
</tr> | ||
</table> | ||
Simple rule to enable poisons based on a specific time threshold and duration. | ||
For instance, you can enable a certain poisons during a specific amount of time (e.g: 1 second) within a time threshold (e.g: 1 minute). | ||
**Arguments**: | ||
- **options** `object` | ||
- **duration** `number` - Enable time inverval in miliseconds. Default to `1000` | ||
- **threshold** `number` - Time period threshold in miliseconds to wait before re-enable the poisoning. Default to `10000` | ||
```js | ||
// Enable the poisoning only 100 miliseconds per each 10 seconds | ||
proxy.rule(toxy.rules.timeThreshold(100)) | ||
// Enable poisoning during 1 second every minute | ||
proxy.rule(toxy.rules.timeThreshold({ duration: 1000, period: 1000 * 60 })) | ||
``` | ||
#### Method | ||
@@ -617,0 +646,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156157
107
3803
1512
7