Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: http2-client
node v10.24.1
endpoint
share
tweet
var {request} = require("http2-client") const h1Target = 'http://www.example.com/'; const h2Target = 'https://www.example.com/'; const req1 = request(h1Target, (res)=>{ console.log(` Url : ${h1Target} Status : ${res.statusCode} HttpVersion : ${res.httpVersion} `); }); req1.end(); req1.setTimeout(1,(req)=>req.abort()) const req2 = request(h2Target, (res)=>{ console.log(` Url : ${h2Target} Status : ${res.statusCode} HttpVersion : ${res.httpVersion} `); }); req2.setTimeout(1,(req)=>req.abort()) req2.end();
Created from: https://npm.runkit.com/http2-client
Loading…
Clone and edit this document