This project is read-only.

ForwardedPortRemote problem

Jul 19, 2012 at 4:32 PM

Hi,

I have following code:    

var client = new SshClient("myserver.com", "root", "mypass");
client.Connect();
var port1 = new ForwardedPortRemote(8081, "www.renci.org", 80);
client.AddForwardedPort(port1);
port1.Start();

And I always get this exception: SystemArgumentException: BoundHost

I also tried to insert this code:

client.RunCommand("touch renci")
And I see renci file created in ~/ directory, so connection to server is definitely working correctly. Please help.

Coordinator
Jul 21, 2012 at 1:11 AM

Hi,

Fro, the top of my head, since I can't look at a code right now, try use this:

var port1 = new ForwardedPortRemote("localhost", 8081, "www.renci.org", 80);

I think at some point we added check for valid bound port, but forgot to handle null case.

 

Also, try to download latest version, since I think I fixed this issue at some point, just don't remember where.

 

Hope it helps,

 

Thanks,

Oleg

Jul 24, 2012 at 3:24 PM

Hi,

I already have latest version, this is not solved. If you will go to issues you will see this bug. Maybe you can include fix in the next version. In the mean time your solution works perfectly.

Coordinator
Aug 10, 2012 at 2:49 PM

Hey,

 

I just now found some time to look at it and using latest code and not providing bound host it still works fine.

What happens is it passes it as empty string, which I think system recognizes as localhost.

 

Can you please let me know if in the code that you using you have 2 ForwardedPortRemote constructors?

 

Thanks,

Oleg