blob: 24fc7fcb8282fefb813c41ba4f040794f494d517 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
'use strict';
const { mustCall } = require('../common');
const http = require('http');
const { strictEqual } = require('assert');
const server = http.createServer(mustCall((req, res) => {
res.flushHeaders();
}));
server.listen(0, mustCall(() => {
const req = http.get({
port: server.address().port
}, mustCall(() => {
const { socket } = req;
socket.emit('agentRemove');
strictEqual(socket._httpMessage, req);
socket.destroy();
server.close();
}));
}));
|