.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "POE::Component::IRC::Plugin::Proxy 3pm" .TH POE::Component::IRC::Plugin::Proxy 3pm "2018-01-01" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" POE::Component::IRC::Plugin::Proxy \- A PoCo\-IRC plugin that provides a lightweight IRC proxy/bouncer .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use strict; \& use warnings; \& use POE qw(Component::IRC::State Component::IRC::Plugin::Proxy Component::IRC::Plugin::Connector); \& \& my $irc = POE::Component::IRC::State\->spawn(); \& \& POE::Session\->create( \& package_states => [ \& main => [ qw(_start) ], \& ], \& heap => { irc => $irc }, \& ); \& \& $poe_kernel\->run(); \& \& sub _start { \& my ($kernel, $heap) = @_[KERNEL, HEAP]; \& $heap\->{irc}\->yield( register => \*(Aqall\*(Aq ); \& $heap\->{proxy} = POE::Component::IRC::Plugin::Proxy\->new( bindport => 6969, password => "m00m00" ); \& $heap\->{irc}\->plugin_add( \*(AqConnector\*(Aq => POE::Component::IRC::Plugin::Connector\->new() ); \& $heap\->{irc}\->plugin_add( \*(AqProxy\*(Aq => $heap\->{proxy} ); \& $heap\->{irc}\->yield ( connect => { Nick => \*(Aqtestbot\*(Aq, Server => \*(Aqsomeserver.com\*(Aq } ); \& return; \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" POE::Component::IRC::Plugin::Proxy is a POE::Component::IRC plugin that provides lightweight \s-1IRC\s0 proxy/bouncer server to your POE::Component::IRC bots. It enables multiple \s-1IRC\s0 clients to be hidden behind a single \s-1IRC\s0 client-server connection. .PP Spawn a POE::Component::IRC::State session and add in a POE::Component::IRC::Plugin::Proxy plugin object, specifying a bindport and a password the connecting \s-1IRC\s0 clients have to use. When the component is connected to an \s-1IRC\s0 network a listening port is opened by the plugin for multiple \s-1IRC\s0 clients to connect. .PP Neat, huh? >;o) .PP This plugin will activate POE::Component::IRC's raw events (\f(CW\*(C`irc_raw\*(C'\fR) by calling \&\f(CW\*(C`$irc\->raw_events(1)\*(C'\fR. .PP This plugin requires the \s-1IRC\s0 component to be POE::Component::IRC::State or a subclass thereof. .SH "METHODS" .IX Header "METHODS" .ie n .SS """new""" .el .SS "\f(CWnew\fP" .IX Subsection "new" Takes a number of arguments: .PP \&\fB'password'\fR, the password to require from connecting clients; .PP \&\fB'bindaddress'\fR, a local address to bind the listener to, default is 'localhost'; .PP \&\fB'bindport'\fR, what port to bind to, default is 0, ie. randomly allocated by \s-1OS\s0; .PP Returns an object suitable for passing to POE::Component::IRC's \f(CW\*(C`plugin_add\*(C'\fR method. .ie n .SS """getsockname""" .el .SS "\f(CWgetsockname\fP" .IX Subsection "getsockname" Takes no arguments. Accesses the listeners \f(CW\*(C`getsockname\*(C'\fR method. See POE::Wheel::SocketFactory for details of the return value; .ie n .SS """list_wheels""" .el .SS "\f(CWlist_wheels\fP" .IX Subsection "list_wheels" Takes no arguments. Returns a list of wheel ids of the current connected clients. .ie n .SS """wheel_info""" .el .SS "\f(CWwheel_info\fP" .IX Subsection "wheel_info" Takes one parameter, a wheel \s-1ID\s0 to query. Returns undef if an invalid wheel id is passed. In a scalar context returns the time that the client connected in unix time. In a list context returns a list consisting of the peer address, port, tthe connect time and the lag in seconds for that connection. .SH "OUTPUT EVENTS" .IX Header "OUTPUT EVENTS" The plugin emits the following POE::Component::IRC events: .ie n .SS """irc_proxy_up""" .el .SS "\f(CWirc_proxy_up\fP" .IX Subsection "irc_proxy_up" Emitted when the listener is successfully started. \f(CW\*(C`ARG0\*(C'\fR is the result of the listener \f(CW\*(C`getsockname\*(C'\fR. .ie n .SS """irc_proxy_connect""" .el .SS "\f(CWirc_proxy_connect\fP" .IX Subsection "irc_proxy_connect" Emitted when a client connects to the listener. \f(CW\*(C`ARG0\*(C'\fR is the wheel \s-1ID\s0 of the client. .ie n .SS """irc_proxy_rw_fail""" .el .SS "\f(CWirc_proxy_rw_fail\fP" .IX Subsection "irc_proxy_rw_fail" Emitted when the POE::Wheel::ReadWrite fails on a connection. \f(CW\*(C`ARG0\*(C'\fR is the wheel \s-1ID\s0 of the client. .ie n .SS """irc_proxy_authed""" .el .SS "\f(CWirc_proxy_authed\fP" .IX Subsection "irc_proxy_authed" Emitted when a connecting client successfully negotiates an \s-1IRC\s0 session with the plugin. \f(CW\*(C`ARG0\*(C'\fR is the wheel \s-1ID\s0 of the client. .ie n .SS """irc_proxy_close""" .el .SS "\f(CWirc_proxy_close\fP" .IX Subsection "irc_proxy_close" Emitted when a connected client disconnects. \f(CW\*(C`ARG0\*(C'\fR is the wheel \s-1ID\s0 of the client. .ie n .SS """irc_proxy_down""" .el .SS "\f(CWirc_proxy_down\fP" .IX Subsection "irc_proxy_down" Emitted when the listener is successfully shutdown. \f(CW\*(C`ARG0\*(C'\fR is the result of the listener \f(CW\*(C`getsockname\*(C'\fR. .SH "QUIRKS" .IX Header "QUIRKS" Connecting \s-1IRC\s0 clients will not be able to change nickname. This is a feature. .SH "AUTHOR" .IX Header "AUTHOR" Chris 'BinGOs' Williams .SH "SEE ALSO" .IX Header "SEE ALSO" POE::Component::IRC .PP POE::Component::IRC::State