NAME

XAS::Lib::SSH::Server - A SSH Subsystem based server

SYNOPSIS

 use XAS::Lib::SSH::Server;

 my $server = XAS::Lib::SSH::Server->new(
     -filter => POE::Filter::Line->new(),
     -eol    => "\015\012",
 );

 $server->run();

DESCRIPTION

The module provides a POE based framework for a SSH subsystem. A SSH subsystem reads from stdin, writes to stdout or stderr. This modules emulates XAS::Lib::Net::Server to provide a consistent interface.

METHODS

new

This initializes the module and starts listening for requests. The following parametrs are used:

-alias

The name of the POE session.

-filter

An optional filter to use, defaults to POE::Filter::Line

-eol

An optional EOL, defaults to "\015\012";

process_request($input, $ctx)

This method will process the input from the client. It takes the following parameters:

$input

The input received from the socket.

$ctx

A hash variable to maintain context. This will be initialized with a "wheel" field. Others fields may be added as needed.

process_response($output, $ctx)

This method will process the output from the client. It takes the following parameters:

$output

The output to be sent to the socket.

$ctx

A hash variable to maintain context. This uses the "wheel" field to direct output to the correct socket. Others fields may have been added as needed.

process_errors($error, $ctx)

This method will process the error output from the client. It takes the following parameters:

$error

The output to be sent to the socket.

$ctx

A hash variable to maintain context. This uses the "wheel" field to direct output to the correct socket. Others fields may have been added as needed.

handle_connection($wheel)

This method is called after the client has connected. This is for additional post connection processing as needed. It takes the following parameters:

$wheel

The id of the clients wheel.

ACCESSORS

peerport

This returns the peers port number.

peerhost

This returns the peers host name.

SEE ALSO

XAS::Lib::SSH::Client
XAS

AUTHOR

Kevin L. Esteb, <kevin@kesteb.us>

COPYRIGHT AND LICENSE

Copyright (c) 2012-2015 Kevin L. Esteb

This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://www.perlfoundation.org/artistic_license_2_0.