untitled notebook

node v15.14.0
version: master
endpointsharetweet
const http2 = require('http2'); const tls = require('tls'); const options = { ALPNProtocols: ['h2'], host: 'nghttp2.org', servername: 'nghttp2.org', port: 443 }; const socket = tls.connect(options, async () => { console.log('Connected!'); await new Promise(resolve => setTimeout(resolve, 1000)); const data = socket.read(); const session = http2.connect('https://nghttp2.org', { createConnection: () => socket }); const kHandle = Object.getOwnPropertySymbols(session).find(x => x.toString() === 'Symbol(kHandle)'); process.nextTick(() => { session[kHandle].receive(data); }); session.once('remoteSettings', () => { console.log('Received remote settings!'); }); });
Loading…

no comments

    sign in to comment