'use strict'
const http = require('http');

const agent = new http.Agent({
    keepAlive: true
});
/*
const req = http.request({
    hostname: 'localhost',
    port: 8080,
    path: '/',
    agent,
    method: 'POST',
}, res => {
    res.on('data', (chunk) => {
        console.log(`BODY: ${chunk}`);
    });

    setImmediate(() => {
        http.request({
            hostname: 'localhost',
            port: 8080,
            path: '/',
            agent,
            method: 'POST',
        }).end();
    })
});
req.end()
 */

const req = http.request({
    hostname: 'localhost',
    port: 8080,
    path: '/',
    // agent,
    // method: 'POST',
});

req.flushHeaders();
setTimeout(() => req.destroy(), 50);

setTimeout(() => {}, 5000);

// req.end();
