GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — http2.connect mishandles the socket option when connecting to an HTTPS server · Issue #32922 · nodejs/node Closed Description
What steps will reproduce the bug?Call const http2 = require('http2'); const net = require('net'); const { HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS } = http2.constants; // Create a normal session, as a control case http2.connect('https://google.com', (clientSession) => { const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); req.on('response', (headers) => { console.log('Response 1:', headers[HTTP2_HEADER_STATUS]); req.on('data', (chunk) => { }); req.on('end', () => { clientSession.close() }); }); }); // Create a session using a socket that has finished connecting const socket = net.connect(443, 'google.com', () => { http2.connect('https://google.com', {socket}, (clientSession) => { const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); req.on('response', (headers) => { console.log('Response 2:', headers[HTTP2_HEADER_STATUS]); req.on('data', (chunk) => { }); req.on('end', () => { clientSession.close() }); }); }); }); // Create a session using a socket that has not yet finished connecting const socket2 = net.connect(443, 'google.com'); http2.connect('https://google.com', {socket2}, (clientSession) => { const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); req.on('response', (headers) => { console.log('Response 3:', headers[HTTP2_HEADER_STATUS]); req.on('data', (chunk) => { }); req.on('end', () => { clientSession.close(); socket2.destroy(); }); }); }); How often does it reproduce? Is there a required condition?This is completely consistent. What is the expected behavior?The expected output is: What do you see instead?The second request never progresses, but is still considered complete, and allows the process to end without any error output. Running this script with Additional informationI discovered this when trying to implement HTTP CONNECT based proxy traversal for an HTTP/2 client. When you make a The problem is that the way a Some other interesting information that didn't really go in the code snippet: in the bad case, the Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |