🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@coder/sshclient

Package Overview
Dependencies
Maintainers
6
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coder/sshclient

A JavaScript library to process client SSH connections. It communicates with an OpenSSH server.

latest
npmnpm
Version
0.1.0
Version published
Maintainers
6
Created
Source

sshclient · MIT license "Latest Release"

sshclient is a JavaScript library to process client SSH connections. It communicates with an OpenSSH server.

❤️ to gopherjs. sshclient uses the golang.org/x/crypto/ssh implementation. Currently the following functionality has been exposed from their API:

  • Port forwarding
  • PTYs
  • Exec

Usage

import * as sshclient from "@coder/sshclient"

// The server hosting this socket is serving sshd on
// port 22 from the host.
const socket = new WebSocket("ws://localhost:8080/ssh")
socket.binaryType = "arraybuffer"
socket.addEventListener("open", () => {
    const conn = sshclient.createConnection((data) => {
        socket.send(data)
    })

    socket.addEventListener("message", (event) => {
        conn.writeToClient(new Uint8Array(event.data))
    })

    sshclient.createClient(conn, {
        username: "kyle",
        password: "example",
    }).then((client) => {
        // 🎊
    })
})

Development

You must have gopherjs and Go 1.12.

yarn
yarn dev

Go source code will be transformed and hot-reloaded by Webpack via gopherjs-loader.js.

License

MIT

FAQs

Package last updated on 29 Jan 2020

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