Skip to content

Do not close the HTTPS servers. #64

@therifler

Description

@therifler

Hey, as long as the module is running in the system, I see a growing number of open ports. How to clean unnecessary open HTTPS servers?

I tried this way on ctx.onResponseEnd:

(Object.keys(proxy.sslServers)).forEach(function (srvName) {
    if (proxy.sslServers[srvName].server._connections === 0 && !proxy.sslServers[srvName].server._handle.reading && proxy.sslServers[srvName].server._handle.writeQueueSize === 0) {
        console.log('Can: ', proxy.sslServers[srvName].server);
        proxy.sslServers[srvName].server.close();
        delete proxy.sslServers[srvName];
        console.log('HTTPS Server: "' + srvName.yellow + '" closed.');
    } else {
        console.log('Cannot: ', proxy.sslServers[srvName].server);
    }
});

Did not work. Proxy client loses the connection and make mistakes. Please help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions