Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Readme

  • Loading branch information...
commit 62db10f9e2d0271d96d30da5282a49cfb9ff3319 1 parent ba612fa
@gildean authored
Showing with 41 additions and 13 deletions.
  1. +19 −0 README.md
  2. +22 −13 blaster.js
View
19 README.md
@@ -0,0 +1,19 @@
+BLASTER
+=======
+
+Blast httpd's with requests.
+
+Usage:
+------
+`node blaster http://someurl timestoblast`
+
+url defaults to localhost and timestoblast defaults to 1
+
+Credits:
+--------
+Inspiration from Killswitch's [joker.js](https://github.com/killswitch/joker.js)
+
+Disclaimer:
+-----------
+I'm not responsible for the damage you might cause with blaster.
+Blast with care.
View
35 blaster.js
@@ -7,6 +7,8 @@ var options = {
port: url.parse(getaddress).port,
path: url.parse(getaddress).path
};
+
+
console.log('\r\n');
console.log('*************************************');
console.log('*______________BLASTER______________*');
@@ -14,23 +16,30 @@ console.log('*************************************');
console.log('Every 1/100 request status is printed');
console.log('Usage: node blaster url timestoblast ');
console.log('\r\n');
-function blaster() {
- var req = http.request(options, function(res) {
- }).on('error', function(e)
- {console.log("Got error: " + e.message);
- });
+
+function blaster(i) {
+ var req = http.request(options, function(res) {
+ if (i%100===0) {
+ console.log('Blasted server answered with: STATUS ' + res.statusCode);
+ }
+ }).on('error', function(e) {
+ console.log("Got error: " + e.message);
+ });
+
req.end();
+
+ if (i%100===0) {
+ console.log('*pew* *pew* (' + i + ' shots taken)');
+ }
+
};
-var i;
-for (i = 0; i < times; i++) {
- if (i%100===0) {
- blaster();
- console.log('request batch ' + i / 100 + ' sent!');
- } else {
- blaster();
- }
+
+for (i=1;i<=times;i++) {
+ blaster(i);
};
+
+console.log('\r\nOut of ammo!\r\n');
Please sign in to comment.
Something went wrong with that request. Please try again.