|
@ -1,6 +1,6 @@ |
|
|
#!/usr/bin/env node
|
|
|
#!/usr/bin/env node
|
|
|
"use strict"; |
|
|
"use strict"; |
|
|
require("more-console"); |
|
|
|
|
|
|
|
|
require("console-dope"); |
|
|
var connect = require("connect"), |
|
|
var connect = require("connect"), |
|
|
http = require("http"), |
|
|
http = require("http"), |
|
|
util = require("util"), |
|
|
util = require("util"), |
|
@ -56,7 +56,7 @@ if (argv.help){ |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
process.on("SIGINT", function(){ |
|
|
process.on("SIGINT", function(){ |
|
|
console.show(); |
|
|
|
|
|
|
|
|
console.showCursor(); |
|
|
console.log(); |
|
|
console.log(); |
|
|
process.exit(0); |
|
|
process.exit(0); |
|
|
}); |
|
|
}); |
|
@ -115,7 +115,7 @@ if (argv.help){ |
|
|
in stats mode, monitor connections and bytes transferred |
|
|
in stats mode, monitor connections and bytes transferred |
|
|
*/ |
|
|
*/ |
|
|
if (!argv["log-format"]){ |
|
|
if (!argv["log-format"]){ |
|
|
console.hide(); |
|
|
|
|
|
|
|
|
console.hideCursor(); |
|
|
console.log("%u{Requests} %u{Data} %u{Connections}"); |
|
|
console.log("%u{Requests} %u{Data} %u{Connections}"); |
|
|
server.on("connection", function(socket){ |
|
|
server.on("connection", function(socket){ |
|
|
var oldWrite = socket.write; |
|
|
var oldWrite = socket.write; |
|
@ -129,7 +129,7 @@ if (argv.help){ |
|
|
}; |
|
|
}; |
|
|
console.column(24).write(++total.connections); |
|
|
console.column(24).write(++total.connections); |
|
|
socket.on("close", function(){ |
|
|
socket.on("close", function(){ |
|
|
console.column(24).write(--total.connections); |
|
|
|
|
|
|
|
|
console.column(24).write((--total.connections + " ").slice(0,12)); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|