Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dlion/toxiproxy-node
Toxiproxy Node Client
https://github.com/dlion/toxiproxy-node
nodejs toxiproxy toxiproxy-node
Last synced: about 1 month ago
JSON representation
Toxiproxy Node Client
- Host: GitHub
- URL: https://github.com/dlion/toxiproxy-node
- Owner: dlion
- License: mit
- Created: 2015-07-01T23:58:20.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-02T17:37:55.000Z (over 9 years ago)
- Last Synced: 2024-04-25T17:42:50.224Z (7 months ago)
- Topics: nodejs, toxiproxy, toxiproxy-node
- Language: JavaScript
- Homepage:
- Size: 106 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# toxiproxy-node
[Toxiproxy](https://github.com/shopify/toxiproxy) Node Client
## Install
`npm install toxiproxy-node`## Usage Example
```js
var toxiproxy = require('toxiproxy-node');//New Client
var client = new toxiproxy('localhost:8474');//New Proxy
var redis = client.NewProxy({
name: 'Redis',
listen: '127.0.0.1:26375',
upstream: '127.0.0.1:6375'
});//Create redis Proxy
redis.Create(function(err, body) {
if(!err) {
//Set Latency
redis.SetToxic('latency', 'downstream', {
enabled: true,
latency: 1000
}, function(err, body) {
//Show Redis downstream info
redis.Toxics('downstream', function(err, body) {
if(!err) {
console.log(body);
//Delete Redis Proxy
redis.Delete(function(){});
}
});
});
}
});
```## Author
* Domenico Luciani
* http://dlion.it
* [email protected]# License
MIT 2015 Domenico Luciani [email protected]