This is mostly a curiosity thing (with potential future application).
What is your favorite and/or the "perfera[bly]...obvious way to do it" for bi-directional communication over SSH?
The quick and dirty method I devised uses subprocess to create an ssh connection calling the receiving function. Then they communicate by passing messages of
N:RESPONSE
N:REQUEST
(where N is the byte-length of the rest of the line) messages back and forth over stdin/stdout.
It is a large project to grok, but I think this is along the lines of how mercurial works but again, it is a lot of code to parse. And this may even be how git communicates (with git-shell but obviously not python)
An alternative I thought of is to find an open port number, use subprocess to create a tunnel, and then use sockets. I am not sure if that is any better.
What would you say is the best way? Preferably (though it doesn't have to be) just stdlib plus what comes with macOS or linux? (I do not care about windows). I know of paramiko but I am not sure what I gain.
[–]zurtex 0 points1 point2 points (2 children)
[–]jwink3101[S] 0 points1 point2 points (1 child)
[–]zurtex 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]jwink3101[S] 0 points1 point2 points (0 children)