New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-ssh2-hook

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-ssh2-hook

React hooks for SSH

  • 0.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Description

React hook to init shell connection via ssh.

Requirements

  • node.js -- v10.16.0 or newer

Installation

Using npm:

npm install react-ssh2-hook

Using yarn:

yarn add react-ssh2-hook

Get started

Simple example

const { initShell, stream } = useShell({
  // See ssh2 lib documentation
  config: {host: 'host', username: 'username', password: 'password'},
  window: { term: 'xterm-256color' },
  onConnect: () => console.log('connected'),
  onData: (data: string) => console.log(data),
  onClose: () => console.log('closed'),
  onError: (err: Error) => console.error(err),
});

Connection hopping

const { initShell, stream } = useShell({
  // Pass an array of SSH2 ConnectConfig
  config: [
      {host: 'host1', username: 'username1', password: 'password1'},
      {host: 'host2', username: 'username2', password: 'password2'}
  ],
  window: { term: 'xterm-256color' },
});

Keywords

FAQs

Package last updated on 07 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc