sshnet / sshnet/SSH.NET

Remote connect with internal System.IO.Stream and without local Socket server

Open
#732 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
4.4k
Forks
993
Avg merge
9d 21h
Merged PRs (30d)
1

Description

Being a library, an application can benefit from being able to connect to a remote socket without a localhost socket binding.

Scenario

(Real-world scenarios help with concrete details. However, this issue is not limited to this kind of scenario)

  • A user is connecting to a PostgreSQL database server on an AWS server
  • The PostgreSQL server is not directly accessible on the internet, but can be accessed via SSH
  • The user is using DBeaver (an imaginary version built with .Net)
  • The user would need to specify at least the SSH IP + PEM certificate

Without this new feature:

  • The user would need to specify the Local Port and Remote Port on the SSH tab.
  • A Socket server would be bound on localhost
  • On the main tab, the user would need to specify whatever is on the local port
  • (Let's ignore the fact that you can leave Local port and Remote port as 0 for dynamic port allocation)
  • If the user wanted to connect to two remote PostgreSQL databases, the user would need to make sure they chose two different local ports that don't conflict.

Instead, with this new feature:

  • The SSH tab settings indicates that whatever is specified on the Main tab is going to be forwarded via the SSH tunnel.
  • The user types in localhost:5432 on the Main tab
  • When the connection is loaded, the SSH tunnel is opened, the remote IP:port is opened and then that stream is used directly by the application.
  • There is no localhost socket binding for forwarding

More Flexibility

This stream capability makes it possible for any application to connect to a remote IP:Port via SSH transparently and privately (without binding a socket server to a localhost port).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by tracing the existing SSH local-forwarding flow and its connection entry points; done means an application can use the SSH-forwarded remote IP and port through an internal System.IO.Stream without binding a localhost socket, including multiple remote database connections.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.