Skip to content

Conversation

@moshevds
Copy link
Contributor

@moshevds moshevds commented Oct 7, 2025

The already supported send_keepalive method is useful for keeping the connection alive, but when the application wants to measure the latency, we need to wait for the response before returning.

"ping" is a rather basic networking feature, but there is a reason why so many protocols have their own ping utility (arping, ndping, hping, httping, ws-ping, quicreach, etc.). Different networks just need different diagnostic tools.

My personal usecase is that I want to do a latency check - to a host that only serves SSH - through a SOCKS proxy. I cannot send ICMP packets because there is a proxy in between the hosts. I'm sure there are many other diagnostic use cases for this. Perhaps there are also other applications that for some reason want to show the connection latency, like 3D shooters typically can do, for example.

In any case, I think this is a useful feature for russh to have, so here I am proposing it, with this PR.

The already supported send_keepalive method is useful for keeping the
connection alive, but when the application wants to measure the latency,
we need to wait for the response before returning.
@Eugeny Eugeny merged commit 6878bf1 into Eugeny:main Oct 9, 2025
11 checks passed
@Eugeny
Copy link
Owner

Eugeny commented Oct 9, 2025

LGTM, thank you

@Eugeny
Copy link
Owner

Eugeny commented Oct 9, 2025

@all-contributors add @moshevds for code

@allcontributors
Copy link
Contributor

@Eugeny

I've put up a pull request to add @moshevds! 🎉

km0e pushed a commit to km0e/russh that referenced this pull request Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants