Just for fun I was creating a JavaScript console for controlling my PC. It involves a small webserver that takes command strings and forwards those to the system using popen calls (to be more specific popen4 on a Ruby mongrel server). The stdout channels are redirected to the http response.
The problem is that the response only arrives once the entire contents of stdout has been sent. This is ok for small commands, but not for a command like find /
which lists all the files in the system. In such situations it would be nice to have the results shown progressively in the webview (just like in the regular terminal).
I thought that using XMLHttpRequest synchronously might result in progressive downloading, but it doesn't seem so.
Is there any way to make it work?