Skip to content

Instantly share code, notes, and snippets.

View paambaati's full-sized avatar
🏠

GP paambaati

🏠
View GitHub Profile
@paambaati
paambaati / got.js
Last active March 1, 2023 00:18
Got with HTTP2 support (ALPN negotiation) + Connect settings overrides
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