The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Footprintless::Tunnel - Provides tunneling over ssh

VERSION

version 1.05

SYNOPSIS

    # Standard way of creating tunnels
    use Footprintless;
    my $tunnel = Footprintless->new()->tunnel($coordinate);

    eval {
        $tunnel->open();
        my $local_hostname = $tunnel->get_local_hostname();
        my $port = $tunnel->get_local_port();

        # do stuff with tunnel
    }
    my $error = $@;
    eval {$tunnel->close()};
    die($error) if ($error);

DESCRIPTION

This module provides tunneling over ssh

ENTITIES

    tunnel => {
        ssh => 'ssh -q',
        local_hostname => 'foo',
        local_port => 1234,
        tunnel_hostname => 'bar',
        tunnel_usename => 'fred',
        destination_hostname => 'baz',
        destination_port => 5678,
        control_socket_dir => '/home/me/.ssh/control_socket'
    }

CONSTRUCTORS

new($entity, $coordinate, %options)

Creates a new tunnel configured by $entities.

METHODS

close()

Closes the tunnel.

get_local_hostname()

Returns the hostname used to access the tunnel.

get_local_port()

Returns the port used to access the tunnel.

is_open()

Returns a truthy value if the tunnel is open.

open()

Opens the tunnel.

AUTHOR

Lucas Theisen <lucastheisen@pastdev.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Lucas Theisen.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

SEE ALSO

Please see those modules/websites for more information related to this module.