0.5.4 • Published 9 months ago

capacitor-ssh-plugin v0.5.4

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

capacitor-ssh-plugin

Supporting libssh2 sessions and channels. Supports both iOS and Android.

Install

npm install capacitor-ssh-plugin
npx cap sync

API

startSessionByPasswd(...)

startSessionByPasswd(options: StartByPasswd) => Promise<SSHSessionID>

connect to a host using a username & password

ParamType
optionsStartByPasswd

Returns: Promise<string>


startSessionByKey(...)

startSessionByKey(options: StartByKey) => Promise<{ session: string; }>

connect to a host using an identity key. The pa

ParamType
optionsStartByKey

Returns: Promise<{ session: string; }>


newChannel(...)

newChannel(options: { session: SSHSessionID; pty?: TerminalType; }) => Promise<{ id: number; }>

given a connected session and an optional terminal type, start a new channel

ParamType
options{ session: string; pty?: TerminalType; }

Returns: Promise<{ id: number; }>


startShell(...)

startShell(options: { channel: SSHChannelID; command?: string; }, callback: STDOutCallback) => Promise<string>

given a channel, start a login shell.

The function also recieves a callback which is called when messages arrive on the channel.

ParamType
options{ channel: number; command?: string; }
callbackSTDOutCallback

Returns: Promise<string>


writeToChannel(...)

writeToChannel(options: { channel: number; s: string; }) => Promise<void>

writes a message to an open channel

ParamType
options{ channel: number; s: string; }

closeChannel(...)

closeChannel(options: { channel: number; }) => Promise<void>
ParamType
options{ channel: number; }

setPtySize(...)

setPtySize(options: { channel: number; width: number; height: number; }) => Promise<void>
ParamType
options{ channel: number; width: number; height: number; }

Interfaces

StartByPasswd

parameters used when opening a session by password

PropType
addressstring
portnumber
usernamestring
passwordstring

StartByKey

parameters used when opening a session by indetity key

PropType
addressstring
portnumber
usernamestring
tagstring

Type Aliases

SSHSessionID

Session ID

string

SSHChannelID

Channel ID

number

STDOutCallback

(message: string | null, err?: any): void

Enums

TerminalType

MembersValue
PtyNone0
PtyTerminalVanilla
PtyTerminalVT100
PtyTerminalVT102
PtyTerminalVT220
PtyTerminalAnsi
PtyTerminalXterm
0.5.4

9 months ago

0.5.3

10 months ago

0.5.2

10 months ago

0.5.1

10 months ago

0.5.0

11 months ago

0.4.1

1 year ago

0.3.0

1 year ago

0.4.0

1 year ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago

0.1.0

2 years ago