Closed
Description
- Version: v14.13.1
- Platform: Linux
- Subsystem: http2
What steps will reproduce the bug?
(example from #35475)
NODE_DEBUG_NATIVE=HTTP2SESSION node
const http2 = require('http2');
const tls = require('tls');
const stream = require('stream');
const options = {
ALPNProtocols: ['h2'],
host: 'nghttp2.org',
servername: 'nghttp2.org',
port: 443
};
const socket = tls.connect(options, async () => {
console.log('TLS Connected!');
const proxy = new stream.Duplex({
read(...args) {
const x = socket.read();
console.log('read', JSON.stringify(x));
if (x !== null)
this.push(x);
},
final(...args) {
socket.end(...args);
},
write(...args) {
socket.write(...args);
},
destroy(...args) {
socket.destroy(...args);
}
});
await new Promise(resolve => setTimeout(resolve, 2000));
const session = http2.connect('https://nghttp2.org', {
createConnection: () => socket
});
session.once('remoteSettings', () => {
console.log('HTTP2 Received remote settings!');
});
session.once('connect', () => {
console.log('HTTP2 Connected!');
});
});
Additional information
master is not affected