node's http module, but for the browser