summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-04-18 17:39:31 -0500
committerJesse Luehrs <doy@tozt.net>2010-04-18 17:39:31 -0500
commit39edf6c5df65950e7257e855cdac792a55bc07d5 (patch)
tree3b3883557cbfd1e9b9e068b7bc6e8395919435b8
parentc2340699c7caea722dd43210cd8bca5fcea22a00 (diff)
downloadapp-termcast-39edf6c5df65950e7257e855cdac792a55bc07d5.tar.gz
app-termcast-39edf6c5df65950e7257e855cdac792a55bc07d5.zip
update docs
-rw-r--r--bin/stream_ttyrec6
-rw-r--r--bin/termcast3
-rw-r--r--lib/App/Termcast.pm77
3 files changed, 74 insertions, 12 deletions
diff --git a/bin/stream_ttyrec b/bin/stream_ttyrec
index 13e0635..4f55cb2 100644
--- a/bin/stream_ttyrec
+++ b/bin/stream_ttyrec
@@ -15,9 +15,9 @@ stream_ttyrec - play a ttyrec to a termcast channel
=head1 DESCRIPTION
-See L<App::Termcast> for options documentation. This program will stream a
-ttyrec file to the given termcast channel. The ttyrec file may be given on the
-command line, or it will be read from STDIN.
+This program will stream a ttyrec file to the given termcast channel. The
+ttyrec file may be given on the command line, or it will be read from STDIN.
+See L<App::Termcast> for options documentation.
=cut
diff --git a/bin/termcast b/bin/termcast
index b97c2dd..d6e41a6 100644
--- a/bin/termcast
+++ b/bin/termcast
@@ -13,7 +13,8 @@ termcast - broadcast your terminal sessions for remote viewing
=head1 DESCRIPTION
-See L<App::Termcast> for documentation.
+Runs C<command> (or a shell, if the command isn't given), while broadcasting it
+to a termcast server. See L<App::Termcast> for options documentation.
=cut
diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm
index e0e2ec9..a4268df 100644
--- a/lib/App/Termcast.pm
+++ b/lib/App/Termcast.pm
@@ -12,23 +12,40 @@ App::Termcast - broadcast your terminal sessions for remote viewing
=head1 SYNOPSIS
- termcast [options] [command]
+ my $tc = App::Termcast->new(user => 'foo');
+ $tc->run('bash');
=head1 DESCRIPTION
App::Termcast is a client for the L<http://termcast.org/> service, which allows
-broadcasting of a terminal session for remote viewing. It will either run a
-command given on the command line, or a shell.
+broadcasting of a terminal session for remote viewing.
+
+=cut
+
+=head1 ATTRIBUTES
+
+=cut
+
+=head2 host
+
+Server to connect to (defaults to noway.ratry.ru, the host for the termcast.org
+service).
=cut
has host => (
is => 'rw',
isa => 'Str',
- default => 'noway.ratry.ru',
+ default => 'termcast.org',
documentation => 'Hostname of the termcast server to connect to',
);
+=head2 port
+
+Port to use on the termcast server (defaults to 31337).
+
+=cut
+
has port => (
is => 'rw',
isa => 'Int',
@@ -36,6 +53,12 @@ has port => (
documentation => 'Port to connect to on the termcast server',
);
+=head2 user
+
+Username to use (defaults to the local username).
+
+=cut
+
has user => (
is => 'rw',
isa => 'Str',
@@ -43,6 +66,16 @@ has user => (
documentation => 'Username for the termcast server',
);
+=head2 password
+
+Password for the given user. The password is set the first time that username
+connects, and must be the same every subsequent time. It is sent in plaintext
+as part of the connection process, so don't use an important password here.
+Defaults to 'asdf' since really, a password isn't all that important unless
+you're worried about being impersonated.
+
+=cut
+
has password => (
is => 'rw',
isa => 'Str',
@@ -51,6 +84,13 @@ has password => (
. " (mostly unimportant)",
);
+=head2 bell_on_watcher
+
+Whether or not to send a bell to the terminal when a watcher connects or
+disconnects. Defaults to false.
+
+=cut
+
has bell_on_watcher => (
is => 'rw',
isa => 'Bool',
@@ -59,6 +99,13 @@ has bell_on_watcher => (
. " or disconnects",
);
+=head2 timeout
+
+How long in seconds to use for the timeout to the termcast server. Defaults to
+5.
+
+=cut
+
has timeout => (
is => 'rw',
isa => 'Int',
@@ -146,6 +193,16 @@ sub _in_ready {
vec($vec, fileno(STDIN), 1);
}
+=head1 METHODS
+
+=cut
+
+=head2 write_to_termcast $BUF
+
+Sends C<$BUF> to the termcast server.
+
+=cut
+
sub write_to_termcast {
my $self = shift;
my ($buf) = @_;
@@ -161,6 +218,14 @@ sub write_to_termcast {
$self->socket->write($buf);
}
+=head2 run @ARGV
+
+Runs the given command in the local terminal as though via C<exec>, but streams
+all output from that command to the termcast server. The command may be an
+interactive program (in fact, this is the most useful case).
+
+=cut
+
sub run {
my $self = shift;
my @cmd = @_;
@@ -239,12 +304,8 @@ no Moose;
=head1 TODO
-Factor some stuff out so applications can call this standalone?
-
Use L<MooseX::SimpleConfig> to make configuration easier.
-Do something about the watcher notifications that the termcast server sends.
-
=head1 BUGS
No known bugs.