I'm currently building a platform for students to learn programming where you can join a "classroom" and watch the other students (or teachers) editors. My first idea was also to post the code to the server and then compile,run it and send the output back. The problem with this method is that there can't be any interactivity in your code, like it is with CodeCube. I think of such things like in C scanf(). So for now every user that joins gets a ubuntu linux box which is provided by docker. So I'm using term.js and pty.js which spawns this minimalistic box and connects /bin/bash via websocket to the client. The code the client writes in his editor can now have scanfs and other interactive functions and is compiled and executed in his own little shell.