Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support local SSH SOCKS proxy server #5

Closed
clue opened this issue Dec 8, 2018 · 0 comments · Fixed by #8
Closed

Support local SSH SOCKS proxy server #5

clue opened this issue Dec 8, 2018 · 0 comments · Fixed by #8
Assignees
Labels
new feature New feature or request
Milestone

Comments

@clue
Copy link
Owner

clue commented Dec 8, 2018

Currently, the SshProcessConnector allows creating plaintext TCP/IP connections which can be used by higher-level protocol implementations. It is implemented by spawning an SSH client like ssh -W google.com:80 user@example.com and will access the standard I/O process streams and represent this as a single connection. Accordingly, it will spawn one process per connection.

As an alternative, we should also support running the local SSH client as a SOCKS proxy server like ssh -D 1080 user@example.com. This will start a local SOCKS proxy server listening on 127.0.0.1:1080 and will accept any number of TCP/IP connections over a single SSH client process.

Technically, this is already supported by manually launching the SSH client using the above command and then simply using https://github.com/clue/reactphp-socks to connect to this local SOCKS proxy server.

Accordingly, we should provide a new class that will automatically spawn this local SOCKS proxy server on demand only and will then use the above SOCKS client library to connect to this server. This means that the process will automatically be spawned on demand only and also that it should be closed when it is not used for some time (idle period similar to friends-of-reactphp/mysql#88).

Additionally, by leveraging the existing SOCKS client implementation we can also provide secure TLS support (#4). I've started looking into this and will keep this ticket updated as I make progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
1 participant