エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
tail -f to the web-browser
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
tail -f to the web-browser
Ever wanted to pipe “tail -f” to a web-page? Here’s a one liner… On the server$ (echo -e ‘HTTP/1.... Ever wanted to pipe “tail -f” to a web-page? Here’s a one liner… On the server$ (echo -e ‘HTTP/1.1 200 OK\nAccess-Control-Allow-Origin: *\nContent-type: text/event-stream\n’ && tail -f /path/to/some/file | sed -u -e ‘s/^/data: /;s/$/\n/’) | nc -l 1234That should all be on a single line. Note: This is for the GNU version of Sed, typically found in Linux distros. If using the BSD version of Sed (e.g