4 ms·
Show HN: Wipes – pipe stdin to your browser over websockets
- voltagex_ 12y agoI'm not sure I like it serving files from the current directory by default - maybe with an extra flag instead?
- apgwoz 12y agoThis isn't meant to be a tool for production usage. It's meant to be a quick "I need to pipe this data into the browser quick for testing / visualization." Though, I am curious -- why do you dislike "." by default?
- jzwinck 12y agoI did something related, but by running a command repeatedly like Unix watch(1): https://github.com/jzwinck/wswatch https://github.com/jzwinck/wswatch
- sheetjs 12y ago> Show HN: Wipes – pipe sdtin to your browser over websockets "sdtin" should be "stdin"
- est 12y agoI am sure I saw similar tool months ago on HN. Someone commented that it looks like inetd in disguise.
- apgwoz 12y agoYou probably mean websocketd? Yes, this is really quite similar, but also much simpler.
- tedchs 12y agoNice project. How does buffering work? Does it queue input lines until a browser connects to the websocket server? If multiple browsers are connected, will it broadcast all stdin lines to all connections? It's not clear to me from the README whether I need to write my own HTML/JS to consume the websockets data. Does it maybe serve a minimal HTML page by default? As feedback, I agree with other commenters that it would be better to make file serving an explicit option instead of default enabled.
- apgwoz 12y agoIt throws away the data if there are no consumers. This probably isn't the best idea, but it's simplest. I'll think a bit about alternatives. And,at this point you need to write your own consumer. The project started because I want to do some real-time visualization from a program written in C. There's a switch which turns on verbose metrics which I can then pipe to wipes.
- tedchs 12y agoGot it. You mind find that wipes would be more similar to other tools that read from STDIN (cat, tail, etc.) if it implements "back pressure" by not reading from STDIN until it has an output to write to. To the user it would appear that wipes is blocking on receiving a websocket connection.