UNPKG

webssh2-server

Version:

A Websocket to SSH2 gateway using xterm.js, socket.io, ssh2

25 lines (24 loc) 872 B
import { EventEmitter } from 'node:events'; import type { Config } from './types/config.js'; import { type SshCredentials, type PtyOptions } from './ssh/config-builder.js'; export default class SSHConnection extends EventEmitter { private readonly config; private conn; private stream; private creds; constructor(config: Config); connect(creds: SshCredentials): Promise<unknown>; private setupConnectionHandlers; shell(options: PtyOptions, envVars?: Record<string, string> | null): Promise<unknown>; exec(command: string, options?: { pty?: boolean; term?: string; rows?: number; cols?: number; width?: number; height?: number; }, envVars?: Record<string, string>): Promise<unknown>; resizeTerminal(rows: number, cols: number): void; end(): void; private getEnvironment; }