clue / reactphp-ssh-proxy

Async SSH proxy connector and forwarder, tunnel any TCP/IP-based protocol through an SSH server, built on top of ReactPHP.
https://clue.engineering/2018/introducing-reactphp-ssh-proxy
MIT License
21 stars 7 forks source link

Windows support #12

Open clue opened 5 years ago

clue commented 5 years ago

The ssh binary is available on recent Windows 10 installations by default, so this shouldn't be too much work.

We have to work around Windows' process I/O pipes (https://github.com/reactphp/child-process#windows-compatibility), e.g. by using socket I/O redirection instead (https://github.com/clue/reactphp-sqlite/pull/13). This should at least support the SOCKS connector, the STDIO/process connector would likely not support this.

Additionally, it looks like sshpass (used for password authentication) is not available on Windows. This means automatic login may not be possible. This may or may not be a problem, but at least pubkey based authentication should work.

clue commented 2 years ago

Small update: Windows support is now much more reasonable as of PHP 8+ because PHP now supports socket pair descriptors (https://github.com/reactphp/child-process/pull/85).

On top of of, we may also be able to avoid the dependency on the sshpass binary for password authentication by employing the SSH_ASKPASS environment variable as discussed in #33.

I'm not currently working on this myself, but figured it makes sense to post here anyway. If you need this for a commercial project and you want to help sponsor this feature, feel free to reach out and I'm happy to take a look. PRs are also welcome! :+1: