<commit_before>[Link to SecTor 2013 Presentation](https://dl.dropboxusercontent.com/u/566560/Running%20at%2099%20percent.pdf)

[Slow/App DoS information and resources](https://gist.github.com/rawdigits/6868177/edit)

#### (The documentation is sparse, will improve this next)

###Dependencies:
npm install http-proxy  
npm install uuid  
npm install optimist  
###Optional:
npm install forever


## Proxy

Usage:
```
/usr/bin/node ./proxy.js -o [loghost] -P [logport] -t [target_host] -p [target_port] -l [proxy_listen_port]

Options:
  -t  [required]
  -p  [required]
  -l  [required]
  -o  [default: "localhost"]
  -P  [default: 5555]
```

## Aggregator

Usage:

```
/usr/bin/node ./aggregator.js  -l [listen_port]
```

## Consumer datastream/commands

View events generated by the proxy:  
```
echo -e "C\n" | ncat localhost 5555
```

Example output:

```
{"time":1379603264938,"type":"connect",
"host":"10.0.0.150"}

{"time":1379603264940,"type":"request",
"host":"10.0.0.150",
"url":"/changelog/","method":"GET",
"headers": (....),"uuid":
"f42095a1-3a4b-41fc-b005-46f504cde2a0"}

{"time":1379603263662,"type":"end",
"uuid":
"f42095a1-3a4b-41fc-b005-46f504cde2a0"}
```

Sending commands to proxy:

`block 10.1.1.1|10000` Block 10.1.1.1 completely for 10 seconds  
`durl /kittens.jpg` Add kittens.jpg to the disabled url list for greylisted hosts  
`grey 10.1.1.2|10000` Add 10.1.1.2 to greylist for 10 seconds  
`flush` Clear blacklist  
<commit_msg>Add a Bitdeli badge to README<commit_after>[Link to SecTor 2013 Presentation](https://dl.dropboxusercontent.com/u/566560/Running%20at%2099%20percent.pdf)

[Slow/App DoS information and resources](https://gist.github.com/rawdigits/6868177/edit)

#### (The documentation is sparse, will improve this next)

###Dependencies:
npm install http-proxy  
npm install uuid  
npm install optimist  
###Optional:
npm install forever


## Proxy

Usage:
```
/usr/bin/node ./proxy.js -o [loghost] -P [logport] -t [target_host] -p [target_port] -l [proxy_listen_port]

Options:
  -t  [required]
  -p  [required]
  -l  [required]
  -o  [default: "localhost"]
  -P  [default: 5555]
```

## Aggregator

Usage:

```
/usr/bin/node ./aggregator.js  -l [listen_port]
```

## Consumer datastream/commands

View events generated by the proxy:  
```
echo -e "C\n" | ncat localhost 5555
```

Example output:

```
{"time":1379603264938,"type":"connect",
"host":"10.0.0.150"}

{"time":1379603264940,"type":"request",
"host":"10.0.0.150",
"url":"/changelog/","method":"GET",
"headers": (....),"uuid":
"f42095a1-3a4b-41fc-b005-46f504cde2a0"}

{"time":1379603263662,"type":"end",
"uuid":
"f42095a1-3a4b-41fc-b005-46f504cde2a0"}
```

Sending commands to proxy:

`block 10.1.1.1|10000` Block 10.1.1.1 completely for 10 seconds  
`durl /kittens.jpg` Add kittens.jpg to the disabled url list for greylisted hosts  
`grey 10.1.1.2|10000` Add 10.1.1.2 to greylist for 10 seconds  
`flush` Clear blacklist  



[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rawdigits/bouncer/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

{'fraction_non_alphanumeric': 0.17774140752864157, 'fraction_numerical': 0.10638297872340426, 'mean_word_length': 4.428063943161634, 'pattern_counts': {'":': 26, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 12, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7089317', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1207, 'n_words': 265}