Table of Contents

Method ForwardDynamicPortAsync

Namespace
SshSharp
Assembly
SshSharp.dll

ForwardDynamicPortAsync(IPEndPoint, CancellationToken)

Dynamic port forwarding (ssh -D): runs a SOCKS proxy on localEndPoint (SOCKS 4, 4a and 5, CONNECT, no authentication). Each application connection names its destination, and the server makes the connection, so host names are resolved on the server's side. Use a loopback address: the proxy has no authentication, so anyone who can reach it can use the server's network.

public Task<SshDynamicPortForwarder> ForwardDynamicPortAsync(IPEndPoint localEndPoint, CancellationToken cancellationToken = default)

Parameters

localEndPoint IPEndPoint
cancellationToken CancellationToken

Returns

Task<SshDynamicPortForwarder>

Exceptions

SocketException

The local endpoint could not be bound (for example the port is in use).