viassh

package module
v0.0.0-...-b7677ac Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

viassh

viassh is a simple demo library for creating remote dialer using a chain of one or more SSH servers. Authentication is done via the ssh-agent.

Example usage

import "github.com/borud/viassh"

// ...

dialer, err := viassh.Create(viassh.Config{
    Hosts:  []string{"user@example.com:22", "user@foo.com:22"},
})

// ...

conn, err := dialer.Dial("tcp","amazon.com:443")

See also the examples directory.

Documentation

Overview

Package viassh provides a convenient method for tunneling connections through one or more SSH tunnels.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParsingHost   = errors.New("error parsing host entry")
	ErrDialing       = errors.New("error dialing host")
	ErrNoHostEntries = errors.New("no via entries specified")
	ErrSSHAgent      = errors.New("error opening ssh-agent")
)

errors

Functions

This section is empty.

Types

type Config

type Config struct {
	// Hosts are on the format username@host:port and all components of the host entry are mandatory.
	Hosts  []string
	Logger *log.Logger
}

Config for dialer.

type Dialer

type Dialer struct {
	// contains filtered or unexported fields
}

Dialer that will tunnel connections through one or more layers of SSH connections.

func Create

func Create(c Config) (*Dialer, error)

Create dialer.

func (*Dialer) Close

func (d *Dialer) Close() error

func (*Dialer) Dial

func (d *Dialer) Dial(prot, addr string) (net.Conn, error)

Dial an address from the remote end and return the connection and possibly an error.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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