Skip to content
This repository was archived by the owner on Nov 19, 2023. It is now read-only.

Commit 1d9df94

Browse files
committed
feat: first commit
0 parents  commit 1d9df94

File tree

18 files changed

+254
-0
lines changed

18 files changed

+254
-0
lines changed

.codeclimate.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
languages:
2+
JavaScript: true
3+
exclude_paths:
4+
- "examples/*.js"

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[Makefile]
12+
charset = utf-8
13+
indent_style = tabs
14+
indent_size = 2
15+
end_of_line = lf
16+
trim_trailing_whitespace = true
17+
insert_final_newline = true
18+
19+
[*.sh]
20+
insert_final_newline = false

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.DS_Store
3+
npm-debug.log
4+
test/.tmp
5+
*.nar

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test/fixtures
2+
*.nar

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: node_js
2+
node_js:
3+
- "0.12"
4+
- "iojs"
5+
- "iojs-v1.6.0"
6+

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
The MIT License
2+
3+
Copyright (c) Tomas Aparicio and contributors
4+
5+
Permission is hereby granted, free of charge, to any person
6+
obtaining a copy of this software and associated documentation
7+
files (the "Software"), to deal in the Software without
8+
restriction, including without limitation the rights to use,
9+
copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the
11+
Software is furnished to do so, subject to the following
12+
conditions:
13+
14+
The above copyright notice and this permission notice shall be
15+
included in all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24+
OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# toxify
2+
3+
Hackable HTTP proxy to simulate system failure conditions. Built for [node.js](http://nodejs.org)/[io.js](https://iojs.org)
4+
5+
**Work in progress**
6+
7+
## Built-in poisons
8+
9+
- [x] Delay
10+
- [_] Server error
11+
- [_] Close socket
12+
- [_] Bandwidth
13+
- [_] Throttle
14+
- [_] Debounce
15+
- [_] Rate limit
16+
- [_] Slow close
17+
- [_] Slicer
18+
19+
## License
20+
21+
MIT - Tomas Aparicio

bin/toxify

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env node
2+
3+
const toxify = require('..')
4+
5+
toxify({})

examples/server.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const toxify = require('..')
2+
3+
const proxy = toxify()
4+
5+
proxy.percentage(80)
6+
proxy.delay({ max: 1000, min: 100 })
7+
proxy.throttle(100)
8+
9+
proxy
10+
.forward('http://httpbin.org')
11+
.all('/*')
12+
13+
proxy.listen(8089)

index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const Toxify = require('./lib/toxify')
2+
3+
module.exports = toxify
4+
5+
function toxify(opts) {
6+
return new Toxify(opts)
7+
}
8+
9+
toxify.poisons = require('./lib/poisons')
10+
toxify.VERSION = require('./package.json').version

0 commit comments

Comments
 (0)