stream a file's tail over password protected http


simple http server with optional http basic auth that will expose a file over HTTP in a similar way to how tail works

tail -f (e.g. live tail) isn't supported, as Chrome stopped rendering live text/plain streams so this module would have to use websockets/xhr instead, which would be more trouble than it is worth

npm install tail-serve -g
tail-serve foo.log

you can specify these options via env variables:

PORT # default 8080
TAILUSER # default 
TAILPASS # default 
TAILSIZE # default 1048576 (1MB)


PORT=80 TAILUSER=foo TAILPASS=bar TAILSIZE=1024 tail-serve app.log

if TAILUSER and TAILPASS are set then tail-serve will require HTTP basic auth for access


var tailserve = require('tail-serve')
var filename = "foo.log"
var options = { user: user, pass: pass, size: size }
var handler = tailserve(filename, options)