Updated web.js to read from the buffer