using node xmlhttprequest to mock browser client