Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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 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
@Starefossen
Copy link

Starefossen commented Oct 16, 2015

If you get 411 Content Length Required error, retry the curl command with -d ''

STREAM=$(curl -sX POST -d '' stream.chunk.io/streams)

@DrGunbot
Copy link

DrGunbot commented Jan 27, 2021

Is this possible with HTTPS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment