code to stream stdout to the browser