HTML Client for X11 SSH Forwarding – Options and Setup

browserremote desktopscreencastingterminal-emulatorx11

Not totally sure if this is the right place but here goes.

I understand that you are able to use X11 to ssh to GUI's and view them, without the server having a full on GUI system running/installed like gnome or something.

My end goal is to be able to "broadcast" my coding sessions online, so people can view them online.

Right now I have set it up so that a restricted tmux session will basically always be mirroring my own personal tmux coding session window. So if you ssh onto the server on a restricted account, you can hop onto the restricted session and follow my coding.

However, I want to be able to let people watch this from their browser. I suspect that the best way is to have some terminal emulator on x11 running on my server attached to the tmux session..and then somehow have the browser view that terminal emulator?

I'm not really too familiar with this domain, so does anyone know if this is possible? Or is there a better approach I should be taking?

Note that I code entirely on a remote headless server that I ssh onto.

Best Answer

It really depends on what exactly you want to end up with.

If you want multiple people connecting to your computer watching what you are doing, then exporting the X session through VNC should do it. You can either run a separate "headless" server (rendering into RAM frame buffer instead of a graphical card memory) or even export your current session with x11vnc. For x11vnc (which you may of course do even with the headless server), the -viewonly option is your friend, since you don't want others to be able to interfere with whatever you do there. There seem to be solutions for connectiong to VNC server from a web browser, for example noVNC or realvnc

To broadcast the video (and optionally audio), so that it can be viewed without any "special" software or played back later, you can use for example ffmpeg which is able to grab X11 data (search for x11grab in docs) and turn it into a video. Of course you can add an audio stream of you commenting it. You can then stream the output and depending on the format and codecs it might be possible to watch it in a browser directly. However, unless you are in academia (or making this as a private, non-commercial activity), you are likely to be legally unable to use some codecs because of their patent encumberedness.

Related Question