Socket
Socket
Sign inDemoInstall

toxy

Package Overview
Dependencies
32
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.12 to 0.3.13

History.md

2

lib/admin/routes/routes.js

@@ -108,3 +108,3 @@ const directives = require('./directives')

function fullRoute (req) {
const route = exports.route(req, route)
const route = exports.route(req)
route.poisons = directives.poisons(req)

@@ -111,0 +111,0 @@ route.rules = directives.rules(req)

{
"name": "toxy",
"version": "0.3.12",
"version": "0.3.13",
"description": "Hackable HTTP proxy to simulate server failure scenarios and network conditions",

@@ -45,4 +45,4 @@ "repository": "h2non/toxy",

"raw-body": "^2.1.2",
"rocky": "^0.4.12",
"router": "^1.1.3"
"rocky": "^0.4.14",
"router": "^1.3.1"
},

@@ -49,0 +49,0 @@ "devDependencies": {

@@ -88,3 +88,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) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)

Furthermore, the majority of the those solutions only operates at TCP L3 level stack instead of providing high-level abstractions to cover common requirements in the specific domain and nature of the HTTP L7 protocol, like toxy tries to provide
Furthermore, the majority of those solutions only operates at TCP L3 level stack instead of providing high-level abstractions to cover common requirements in the specific domain and nature of the HTTP L7 protocol, like toxy tries to provide

@@ -102,3 +102,3 @@ toxy brings a powerful hackable and extensible solution with a convenient abstraction, but without losing a proper low-level interface capabilities to deal with HTTP protocol primitives easily.

**Rules** are a kind of match validation filters that inspects an HTTP request/response in order to determine, given a certain rules, if the HTTP transaction should be poisioned or not (e.g: if headers matches, query params, method, body...).
**Rules** are a kind of match validation filters that inspects an HTTP request/response in order to determine, given a certain rules, if the HTTP transaction should be poisoned or not (e.g: if headers matches, query params, method, body...).
Rules can be reused and applied to both incoming and outgoing traffic flows, including different scopes: global, route or poison level.

@@ -246,3 +246,3 @@

**Outgoing** poisoning refers to the traffic that has been forwarded to the target server and
when proxy recieves the response from it, but that response has not been sent to the client yet.
when proxy receives the response from it, but that response has not been sent to the client yet.

@@ -279,3 +279,3 @@ This means, essentially, that you can plug in your poisons to infect the HTTP traffic

- **options** `object`
- **jitter** `number` - Jitter value in miliseconds
- **jitter** `number` - Jitter value in milliseconds
- **max** `number` - Random jitter maximum value

@@ -345,3 +345,3 @@ - **min** `number` - Random jitter minimum value

- **bytes** `number` - Amount of chunk of bytes to send. Default `1024`
- **threshold** `number` - Packets time frame in miliseconds. Default `1000`
- **threshold** `number` - Packets time frame in milliseconds. Default `1000`

@@ -368,3 +368,3 @@ ```js

Note that this is very simple rate limit implementation, indeed limits are stored in-memory, therefore are completely volalite.
Note that this is very simple rate limit implementation, indeed limits are stored in-memory, therefore are completely volatile.
There're a bunch of featured and consistent rate limiter implementations in [npm](https://www.npmjs.com/search?q=rate+limit) that you can plug in as poison. You might be also interested in [token bucket algorithm](http://en.wikipedia.org/wiki/Token_bucket).

@@ -376,3 +376,3 @@

- **limit** `number` - Total amount of requests. Default to `10`
- **threshold** `number` - Limit time frame in miliseconds. Default to `1000`
- **threshold** `number` - Limit time frame in milliseconds. Default to `1000`
- **message** `string` - Optional error message when limit is reached.

@@ -389,3 +389,3 @@ - **code** `number` - HTTP status code when limit is reached. Default to `429`.

<tr>
<td><b>Name</b></td><td>rateLimit</td>
<td><b>Name</b></td><td>slowRead</td>
</tr>

@@ -406,3 +406,3 @@ <tr>

- **chunk** `number` - Packet chunk size in bytes. Default to `1024`
- **threshold** `number` - Limit threshold time frame in miliseconds. Default to `1000`
- **threshold** `number` - Limit threshold time frame in milliseconds. Default to `1000`

@@ -433,3 +433,3 @@ ```js

- **options** `object`
- **delay** `number` - Delay connection in miliseconds. Default to `1000`
- **delay** `number` - Delay connection in milliseconds. Default to `1000`

@@ -459,3 +459,3 @@ ```js

- **options** `object`
- **delay** `number` - Delay time in miliseconds. Default to `1000`
- **delay** `number` - Delay time in milliseconds. Default to `1000`

@@ -486,3 +486,3 @@ ```js

- **chunk** `number` - Packet chunk size in bytes. Default to `1024`
- **delay** `object` - Data chunk delay time frame in miliseconds. Default to `100`
- **delay** `object` - Data chunk delay time frame in milliseconds. Default to `100`

@@ -512,3 +512,3 @@ ```js

- **options** `object`
- **delay** `number` - Aborts TCP connection after waiting the given miliseconds. Default to `0`
- **delay** `number` - Aborts TCP connection after waiting the given milliseconds. Default to `0`
- **next** `boolean` - If `true`, the connection will be aborted if the target server takes more than the `delay` param time to reply. Default to `false`

@@ -546,3 +546,3 @@ - **error** `Error` - Custom internal node.js error to use when destroying the socket. Default to `null`

- **miliseconds** `number` - Timeout limit in miliseconds
- **miliseconds** `number` - Timeout limit in milliseconds

@@ -587,3 +587,3 @@ ```js

.get('/foo')
.poison(customLatency(2000))
.poison(customLatencyPoison(2000))
```

@@ -654,7 +654,7 @@

- **options** `object`
- **duration** `number` - Enable time inverval in miliseconds. Default to `1000`
- **threshold** `number` - Time threshold in miliseconds to wait before re-enable the poisoning. Default to `10000`
- **duration** `number` - Enable time inverval in milliseconds. Default to `1000`
- **threshold** `number` - Time threshold in milliseconds to wait before re-enable the poisoning. Default to `10000`
```js
// Enable the poisoning only 100 miliseconds per each 10 seconds
// Enable the poisoning only 100 milliseconds per each 10 seconds
proxy.rule(toxy.rules.timeThreshold(100))

@@ -865,3 +865,3 @@ // Enable poisoning during 1 second every minute

Rules are simple middleware functions that resolve asyncronously with a `boolean` value to determine if a given HTTP transaction should be ignored when poisoning.
Rules are simple middleware functions that resolve asynchronously with a `boolean` value to determine if a given HTTP transaction should be ignored when poisoning.

@@ -1195,3 +1195,3 @@ Your rule must resolve with a `boolean` param calling the `next(err,

Further actions you perform againts the `ToxyRoute` API will only be applicable at route-level (nested). In other words: you already know the API.
Further actions you perform against the `ToxyRoute` API will only be applicable at route-level (nested). In other words: you already know the API.

@@ -1198,0 +1198,0 @@ This example will probably clarify possible doubts:

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc