sshclient

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sshclient contains the transport-independent half of croc's SSH client. Native and browser callers provide an already-authenticated byte stream plus their own terminal input and output adapters.

Index

Constants

View Source
const DefaultHandshakeTimeout = 30 * time.Second

Variables

This section is empty.

Functions

func HandshakeError

func HandshakeError(ctx context.Context, contextDeadline time.Time, err error) error

func Run

func Run(ctx context.Context, connection net.Conn, config Config) (bool, error)

Run pins the authenticated host key, opens one interactive PTY, and waits for the shared shell or context to end. It intentionally exposes no remote commands, forwarding, or subsystems.

Types

type Config

type Config struct {
	ExpectedHostKey  gossh.PublicKey
	ClientAuth       []byte
	TerminalName     string
	InitialSize      WindowSize
	Input            io.Reader
	PrepareInput     func() (io.Reader, func(), error)
	Output           io.Writer
	ErrorOutput      io.Writer
	Resizes          <-chan WindowSize
	HandshakeTimeout time.Duration
	BeforeShell      func() (func(), error)
	OnConnected      func()
}

type WindowSize

type WindowSize struct {
	Width  int
	Height int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL