title: how to live stream mp3 files using node js
body: <p>I want my code in node js to live stream an mp3 file in real time (which means always running on the server).</p>
  
  <p>I wrote this code:</p>
  
  <pre><code>var http = require('http');
  var fs = require('fs');
  http.createServer(function(req, res) {
      res.writeHead(200, {
          'Content-Type': 'audio/mp3'
      });
      var rs = fs.createReadStream('audio.mp3');
      rs.pipe(res);
  })
  </code></pre>
  
  <p>The problem is that when I refresh the page, the stream starts all over again.  I want it to act as a live stream so that when I refresh, the page will start in a different position.</p>