title: Minimal web server using netcat
body: <p>I'm trying to set up a minimal web server using netcat (nc). When the browser calls up localhost:1500, for instance, it should show the result of a function (<em>date</em> in the example below, but eventually it'll be a python or c program that yields some data).
  My little netcat web server needs to be a while true loop in bash, possibly as simple as this:</p>
  
  <pre><code>while true ; do  echo -e "HTTP/1.1 200 OK\n\n $(date)" | nc -l -p 1500  ; done
  </code></pre>
  
  <p>When I try this the browser shows the currently available data during the moment when nc starts. I want the browser displays the data during the moment the browser requests it, though. How can I achieve this?</p>