Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[support] SSH caching? #18

@mdavis-xyz

Description

@mdavis-xyz

My SSH server can sometimes take up to 30 seconds to accept an SSH connection. I don't have control over the server, so I can't fix this.

One of the main reasons I wanted to use mallory (instead of just an SSH tunnel done inside my python code that sends the HTTP requests) is that I wanted to spend 30 seconds connecting once, and then holding that connection open for minutes/hours/days, to make subsequent HTTP requests quick. i.e. sharing the SSH connection between multiple HTTP calls.

However I find that the round trip time through mallory is still approximately 30 seconds, which makes me suspect that a new SSH connection is being created for each HTTP request.

I tried to read the code to see how the caching of the SSH connection works, but I couldn't quite see what's happening.
How is it supposed to work?

The mallory logs show a round trip time which is approximately 40 milliseconds, when my curl command takes about 30 seconds to return. So I think the time in the logs does not include the time required to set up the SSH tunnel. Perhaps it should?

Note that this command is slow:

curl -x localhost:1316 my.server.fqdn:80/path

But this one is fast:

curl -x localhost:1316 localhost:80/path

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