consthttp=require('http')http.get('http://localhost/index.html',{headers:{user:'bob',password:'supersecretpassword'}},res=>{// If allowed to access the page, print it outif(res.statusCode===200)res.pipe(process.stdout)elseconsole.error('Invalid login')})