Net::SS...::Client(3)
π NAME π
Net::SSH::Perl::Subsystem::Client β bestie, it's the subsystem client base class π
β¨ SYNOPSIS β¨
okay so here's the whole vibe in one go:
package My::Subsystem;
use Net::SSH::Perl::Subsystem::Client;
@ISA = qw( Net::SSH::Perl::Subsystem::Client );
use constant MSG_HELLO => 1;
sub init {
my $system = shift;
$system->SUPER::init(@_);
my $msg = $system->new_msg(MSG_HELLO);
$msg->put_str("Hello, subsystem server.");
$msg->send;
}
sub subsystem { "mysubsystem" }
like. that's it. that's the whole inheritance moment π
π¦ DESCRIPTION π¦
So Net::SSH::Perl::Subsystem::Client makes writing a client for an SSH-2 subsystem so much less of a whole thing. A subsystem is generally a networking protocol built on top of an SSH channel β and the channel is the one doing all the heavy lifting: transport, connection, encryption, authentication, message integrity, etc. The subsystem client and server talk to each other over this encrypted, secure channel (a channel built over an insecure network, which is iconic honestly). SSH handles the encrypted transport, and then the subsystem gets to just... be a standard networking protocol. main character energy, no notes. π
Subsystem::Client is built on top of Net::SSH::Perl, which provides the client end of all those services described above (encryption, message integrity checking, authentication, etc.). It's designed to be used with a subsystem server, working with respect to an agreed-upon networking protocol. fr fr.
SFTP is a whole example of a subsystem: the underlying transport is set up by Net::SSH::Perl, and on top of that layer, files can be transferred and filesystems managed without any knowledge of the secure tunnel. the way that works?? obsessed π«Ά
πΈ USAGE πΈ
Net::SSH::Perl::Subsystem::Client is intended to be used as a base class for your protocol-specific client. It handles all interaction with Net::SSH::Perl so that your focus can be on sending commands to the subsystem server, etc. lowkey the nicest thing a base class can do for you π
Your subclass will probably be most interested in using and/or overriding the following methods:
π§ $sc->init(%args)
Initializes a new Subsystem::Client object: builds the SSH tunnel using Net::SSH::Perl, then opens up a channel along which the subsystem traffic will be sent. It then opens a connection to the subsystem server. three steps, one method, slay β¨
You can override this method to provide any additional functionality that your client might need; for example, you might wish to use it to send an 'init' message to the subsystem server. go off, customise π
π«Ά heads up bestie: if you do override it, you're the one responsible for calling SUPER::init(@_) in there β that's literally what the SYNOPSIS example does, and it's how the tunnel, channel and connection actually get set up. don't skip it, or nothing else in your client is gonna have a channel to talk over π
and that's the whole page, we ate π no crumbs. this one's from the User Contributed Perl Documentation, shipped with perl v5.42.0 and dated 2026-01-17 β write it down bestie, that's the version and the date, periodt. ππ
π¦ where this page comes from
- fedora 44: perl-Net-SSH-Perl 2.144-2.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms