Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠

GP paambaati

🏠
View GitHub Profile
@paambaati
paambaati / got.js
Last active Dec 24, 2018
Got with HTTP2 support (ALPN negotiation) + Connect settings overrides
View got.js
const {extend: gotExtend} = require('got');
const http2 = require('http2-wrapper');
const resolveALPN = require('resolve-alpn');
// Taken from https://github.com/nodejs/node/blob/d4c91f28148af8a6c1a95392e5c88cb93d4b61c6/lib/_http_agent.js
//
// throws
// tls.connect({host: 'httpbin.org', port: 443});
//
// doesn't throw