Remote port forwarding
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 993
- Avg merge
- 9d 21h
- Merged PRs (30d)
- 1
Description
I have a linux VM on azure cloud and a remote system.
I am trying to get port forwarding to work. So far I have the folloowing.
private void createConn()
{
try
{
if (!client.IsConnected)
{
client.Connect();
Console.WriteLine("Successful!!!!");
client.SendKeepAlive();
var port = new ForwardedPortRemote("127.0.0.1", 22, "127.0.0.1", 22222);
client.AddForwardedPort(port);
Console.WriteLine("port.Start");
port.Start();
Console.WriteLine("Hold port open..");
port.Stop();
Console.WriteLine("port closed");
client.Disconnect();
}
}
catch (Exception e)
{
ErrorLog.Error("Connection Failed!!!", e.Message);
}
}
The code runs fine but my connection gets refused when I try to run "ssh user@localhost -p 22222" in my azure VM. Do you have any idea what I am missing here?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at createConn and the ForwardedPortRemote entry point, then reproduce the reported connection-refused result from the Azure VM using the shown arguments. Check the port and client lifecycle around port.Start(), port.Stop(), and client.Disconnect(); done means the expected remote forwarding behavior is documented or reproduced with a confirmed fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- cloud, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100