MkeepSocketAlive
Bun

method

http.Agent.keepSocketAlive

socket: Duplex
): void;

Called when socket is detached from a request and could be persisted by theAgent. Default behavior is to:

socket.setKeepAlive(true, this.keepAliveMsecs);
socket.unref();
return true;

This method can be overridden by a particular Agent subclass. If this method returns a falsy value, the socket will be destroyed instead of persisting it for use with the next request.

The socket argument can be an instance of net.Socket, a subclass of stream.Duplex.