@microsoft/dev-tunnels-ssh-tcp
Version:
SSH TCP extensions library for Dev Tunnels
36 lines • 2.05 kB
TypeScript
import { Disposable } from 'vscode-jsonrpc';
import { SshClientSession, SshSessionConfiguration, Stream, CancellationToken, Trace } from '@microsoft/dev-tunnels-ssh';
/**
* Enables opening an SSH session over a TCP connection.
*
* It's possible to create an `SshClientSession` over any `Stream` instance;
* this class is merely a convenient helper that manages creating a session
* over a Node.js TCP `Socket`.
*/
export declare class SshClient implements Disposable {
private config;
private static readonly defaultServerPort;
private readonly sessions;
constructor(config: SshSessionConfiguration);
/**
* Gets or sets a function that handles trace messages associated with the client session.
*
* By default, no messages are traced. To enable tracing, set this property to a function
* that routes the message to console.log, a file, or anywhere else.
*
* @param level The level of message being traced: error, warning, info, or verbose.
* @param eventId An integer that identifies the type of event. Normally this is one of
* the values from `SshTraceEventIds`, but extensions may define additional event IDs.
* @param msg A description of the event (non-localized).
* @param err Optional `Error` object associated with the event, often included with
* warning or error events. While the `Error.message` property is typically included as
* (part of) the `msg` parameter, the error object may contain additional useful context
* such as the stack trace.
*/
trace: Trace;
openSession(serverHost: string, serverPort?: number, cancellation?: CancellationToken): Promise<SshClientSession>;
protected openConnection(serverHost: string, serverPort?: number, cancellation?: CancellationToken): Promise<Stream>;
reconnectSession(session: SshClientSession, serverHost: string, serverPort?: number, cancellation?: CancellationToken): Promise<void>;
dispose(): void;
}
//# sourceMappingURL=sshClient.d.ts.map