Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Starefossen/4bbc683ef1a80b386531 to your computer and use it in GitHub Desktop.
Save Starefossen/4bbc683ef1a80b386531 to your computer and use it in GitHub Desktop.
Stream a tmux session in realtime over HTTP

On the server with tmux

Create a new tmux session:

tmux new-session -s my-session # launch `top`, `htop`, or anything that will regularly updates, then detach

Stream your session:

STREAM=$(curl -sX POST -d '' stream.chunk.io/streams)
echo $STREAM
socat EXEC:"tmux attach -t my-session",pty,stderr EXEC:"curl -T - $STREAM"

On the client(s)

curl --no-buffer $STREAM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment