Last active
March 8, 2019 10:02
-
-
Save horttanainen/1b9326f61c16b6bb52b4008e3ede11e2 to your computer and use it in GitHub Desktop.
Script to serve piped text indefinitely
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
node -e 'var http = require("http"); var fs = require("fs"); process.stdin.resume(); process.stdin.setEncoding("utf8"); var data = ""; process.stdin.on("data", function(buf) { data += buf; }); process.stdin.on("end", function() { http.createServer(function (request, response) { response.writeHead(200); response.write(data); response.end(); }).listen(8989); });' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add the snippet in your .bashrc
Try it out: