-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Closed
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.
Description
- Version: v8.12.0
- Platform: linux ,windows
- Subsystem:
Here is the code that can be reproduced:
const http = require('http');
const net = require('net');
const httpserver = http.createServer((req,res)=>{
console.log('~~ http request');
res.end('aaa');
})
httpserver.on('connection',(socket)=>{
console.log('httpsever connection');
})
const netserver = net.createServer((socket)=>{
console.log('netserver connection');
httpserver.emit('connection',socket);
// This listener is not important.
socket.once('data',(data)=>{
console.log('netserver data',data.toString());
// This line of code is not important.
socket.emit('data',data);
});
}).listen(30332);
The same code run in v10.9.0 and v8.10.0 has been tested without issue.
This is a bug ,because of http_event_connection.
Note: This event can also be explicitly emitted by users to inject connections into the HTTP server. In that case, any Duplex stream can be passed.
Metadata
Metadata
Assignees
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.