Question: HTTPSAgent reuse
any way to reuse ssh2 connection for node-fetch agent ?
i am using ssh2.HTTPSAgent agent with node-fetch to pass thru http requests, all works perfectly only thing is it reconnects on each requests and that adds bit of a delay if i can reuse ssh2 connection would'd be way faster
Reusing a connection is not currently supported for HTTP(S) agents. The reason being that's the only sure way to make sure the server will have a channel available to process the request.
Additionally, connection reuse complicates things a little bit since that would require maintaining a pool of SSH connections.
Adding support isn't impossible, but for now it's just not supported.
can i somehow do dirty solution which just tris if server had connection room and doesn't guarantee it ?
I'm not sure what you're asking exactly, but there is nothing stopping you from copying the existing implementation and tweaking it for your own needs.