Table of Contents

Class SshLocalPortForwarder

Namespace
SshSharp
Assembly
SshSharp.dll

A local port forwarding (ssh -L) started by ForwardLocalPortAsync(IPEndPoint, string, int, CancellationToken) or its overload: connections to LocalEndPoint are relayed through the server to RemoteHost:RemotePort, or to the Unix socket RemoteSocketPath there. Dispose it to stop listening and close the forwarded connections.

public sealed class SshLocalPortForwarder : IAsyncDisposable
Inheritance
SshLocalPortForwarder
Implements
Inherited Members

Properties

ActiveConnections

How many forwarded connections are open now.

LocalEndPoint

The local address and port being listened on (with the actual port when 0 was asked for).

RemoteHost

Where the server connects each forwarded connection to; empty when it connects to RemoteSocketPath.

RemotePort

The port on RemoteHost; 0 when the server connects to RemoteSocketPath.

RemoteSocketPath

The Unix socket on the server each forwarded connection goes to (ssh -L port:/remote/socket), or null when it goes to RemoteHost:RemotePort.

Methods

DisposeAsync()

Stops listening and closes every forwarded connection.