Updated to read from index.html and use buffers.