clio - Command Line Input/Output with sockets and HTTP
version 0.02
$ cpanm Clio # install $ vim ~/clio.conf # configure $ CLIO_CONFIG=~/clio.conf clio # run
Clio will allow you to connect to your command line utilities over network socket and HTTP.
<Daemon> User nobody Group nobody PidFile /var/run/clio.pid </Daemon> <Command> # Echo chamber Exec "cat -" # or watch you log files # Exec "tail -f /var/log/{maillog,messages,secure}" # or run top in batch mode # Exec "top -b" # or shell backdoor # Exec "sh -s" StartCommands 0 MinSpareCommands 0 MaxSpareCommands 0 MaxCommands 20 MaxClientsPerCommand 10 InputFilter LineEnd OutputFilter +MyClio::OutputFilter </Command> # HTTP server with WebSocket clients <Server> Listen 0:12345 Class HTTP # HTTP server Plack app wrapper Builder /var/www/clio/plack.psgi <Client> Class WebSocket InputFilter +MyClio::InputFilter::Uppercase OutputFilter LineEnd </Client> </Server> <Log> Class Log4perl <Config> log4perl.logger=Error, Log log4perl.appender.Log=Log::Dispatch::File log4perl.appender.Log.filename=/var/log/clio/clio.log log4perl.appender.Log.mode=append log4perl.appender.Log.layout=Log::Log4perl::Layout::SimpleLayout </Config> </Log>
There are folowing main configuration blocks:
If <Daemon> is present then clio process will daemonize itself.
<Daemon>
User
Group
Specify user and group under which the server will answer requests.
PidFile
Path to pid file.
Configuration block of command to be executed.
Exec
Command to be executed.
StartCommands
Number of command processes created at startup.
MinSpareCommands
Minimum number of idle command processes.
MaxSpareCommands
Maximum number of idle command processes.
MaxCommands
Maximum number of running command processes.
MaxClientsPerCommand
Maximum number of connected client processes per command.
InputFilter
OutputFilter
Optional name of the packages used to filter command's input and output.
If name does not start with + then Clio::Process prefix will be used to load specified filter, eg Clio::ProcessInputFilter::LineEnd.
+
Listen
IP address and port that the server listens to.
Class
Name of the package acting as server.
If name does not start with + then Clio::Server:: prefix will be used to load specified filter, eg Clio::Server::HTTP.
Servers may specify additional parameters, eg. Clio::Server::HTTP allows Builder option.
Builder
Optional path to file returning Plack application - object with to_app() method or simply PSGI applicationcode reference, see examples/ dir.
to_app()
Note: option used by Clio::Server::HTTP only.
Client
Inner block defining Server's Client options.
Name of the package acting as client.
If name does not start with + then resolved Server's Class prefix + ::Client:: will be used to load specified filter, eg Clio::Server::HTTP::Client::WebSocket.
Optional name of the packages used to filter client's input and output.
Log configuration block.
Name of the package acting as logger.
If name does not start with + then Clio::Log:: prefix will be used to load specified filter, eg Clio::Log::Log4perl.
Config
Class specific configuration.
Alex J. G. Burzyński <ajgb@cpan.org>
This software is copyright (c) 2012 by Alex J. G. Burzyński <ajgb@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Clio, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Clio
CPAN shell
perl -MCPAN -e shell install Clio
For more information on module installation, please visit the detailed CPAN module installation guide.