diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/Guide/Guide.Command.StatusCode.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/Guide/Guide.Command.StatusCode.aml index b6a81611..2a3a363b 100644 --- a/Renci.SshClient/Renci.SshClient/Documentation/Content/Guide/Guide.Command.StatusCode.aml +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/Guide/Guide.Command.StatusCode.aml @@ -8,7 +8,7 @@ - Display exit status when command is executed.. + Display exit status when command is executed. using (var client = new SshClient("host", "username", "password")) { diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/Guide/Guide.PortForward.Local.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/Guide/Guide.PortForward.Local.aml new file mode 100644 index 00000000..7c62a049 --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/Guide/Guide.PortForward.Local.aml @@ -0,0 +1,30 @@ + + + + + + Start and stop local port forwarding. + + using (var client = new SshClient("host", "username", "password")) + { + client.Connect(); + var port = client.AddForwardedPort<ForwardedPortLocal>(8084, "host to be forwarded", 80); + port.Exception += delegate(object sender, ExceptionEventArgs e) + { + Console.WriteLine(e.Exception.ToString()); + }; + port.Start(); + + Thread.Sleep(1000 * 60 * 20); // Wait 20 minutes for port to be forwarded + + port.Stop(); + } + + + + + T:Renci.SshClient.SshClient + T:Renci.SshClient.ForwardedPortLocal + + + \ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/Guide/Guide.PortForward.Remote.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/Guide/Guide.PortForward.Remote.aml new file mode 100644 index 00000000..93678a6a --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/Guide/Guide.PortForward.Remote.aml @@ -0,0 +1,30 @@ + + + + + + Start and stop local port forwarding. + + using (var client = new SshClient("host", "username", "password")) + { + client.Connect(); + var port = client.AddForwardedPort<ForwardedPortRemote>(8082, "host to be forwarded", 80); + port.Exception += delegate(object sender, ExceptionEventArgs e) + { + Console.WriteLine(e.Exception.ToString()); + }; + port.Start(); + + Thread.Sleep(1000 * 60 * 20); // Wait 20 minutes for port to be forwarded + + port.Stop(); + } + + + + + T:Renci.SshClient.SshClient + T:Renci.SshClient.ForwardedPortLocal + + + \ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/Guide/Guide.PortForward.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/Guide/Guide.PortForward.aml new file mode 100644 index 00000000..ce22bfde --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/Guide/Guide.PortForward.aml @@ -0,0 +1,17 @@ + + + + + Port forwarding supported for remote and local ports. + Multiple port can be forwarded simultaneously. + To start port forwarding you need to create an T:Renci.SshClient.ForwardedPortLocal or T:Renci.SshClient.ForwardedPortRemote object. + Once port object is created you can use M:Renci.SshClient.ForwardedPort.Start start port forwarding or M:Renci.SshClient.ForwardedPort.Stop to stop it. + + + + An exception can be thrown while port is forwarded. When this happens an E:Renci.SshClient.ForwardedPort.Exception event is raised. + + + + + \ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Renci.SshClient.content b/Renci.SshClient/Renci.SshClient/Documentation/Renci.SshClient.content index a5b50d54..a9e46167 100644 --- a/Renci.SshClient/Renci.SshClient/Documentation/Renci.SshClient.content +++ b/Renci.SshClient/Renci.SshClient/Documentation/Renci.SshClient.content @@ -18,6 +18,10 @@ + + + + diff --git a/Renci.SshClient/Renci.SshClient/Renci.SshClient.csproj b/Renci.SshClient/Renci.SshClient/Renci.SshClient.csproj index 8a207c55..53842f20 100644 --- a/Renci.SshClient/Renci.SshClient/Renci.SshClient.csproj +++ b/Renci.SshClient/Renci.SshClient/Renci.SshClient.csproj @@ -272,6 +272,9 @@ + + +