POE::C...:Proxy(3pm)
β¨ POE::C...:Proxy(3pm) β the manual page, but make it make sense β¨
okay bestie, pull up a chair, we're reading the POE::Component::IRC::Plugin::Proxy page from the User Contributed Perl Documentation and honestly? it's a banger. it's a PoCo-IRC plugin that hands you a lightweight IRC proxy/bouncer. yes, a bouncer. we're building infrastructure today. π
πΈ NAME πΈ
POE::Component::IRC::Plugin::Proxy β a PoCo-IRC plugin that provides a lightweight IRC proxy/bouncer. it's giving "one connection to rule them all" and I'm obsessed. π«Ά
π SYNOPSIS π
look at this. look at how clean. copy it exactly, don't freestyle:
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 => 'all' );
$heap->{proxy} = POE::Component::IRC::Plugin::Proxy->new( bindport => 6969, password => "m00m00" );
$heap->{irc}->plugin_add( 'Connector' => POE::Component::IRC::Plugin::Connector->new() );
$heap->{irc}->plugin_add( 'Proxy' => $heap->{proxy} );
$heap->{irc}->yield ( connect => { Nick => 'testbot', Server => 'someserver.com' } );
return;
}
yeah, 6969 and "m00m00" are literally what the author wrote. iconic of him, honestly. π
π DESCRIPTION π
POE::Component::IRC::Plugin::Proxy is a POE::Component::IRC plugin that gives your POE::Component::IRC bots a lightweight IRC proxy/bouncer server. the whole point? it lets multiple IRC clients hide behind a single IRC client-server connection. sneaky. efficient. slay.
so here's the vibe: you spawn a POE::Component::IRC::State session and drop a POE::Component::IRC::Plugin::Proxy plugin object in there, handing it a bindport and a password that any connecting IRC client has to use. then, once the component is connected to an IRC network, the plugin opens up a listening port so all your little IRC clients can pile in. π¦
Neat, huh? >;o) β and that's a direct quote, I would never steal that energy.
this plugin will activatePOE::Component::IRC's raw events (irc_raw) by calling$irc->raw_events(1).
heads up bestie: this plugin requires the IRC component to be POE::Component::IRC::State or a subclass of it. no substitutions. π«
π METHODS π
π new
takes a number of arguments:
'password'β the password to require from connecting clients. no password, no entry. π'bindaddress'β a local address to bind the listener to, default is'localhost'.'bindport'β what port to bind to, default is0, ie. randomly allocated by OS. chaotic but valid.
returns an object suitable for passing to POE::Component::IRC's plugin_add method. handoff complete, bestie. π€
π getsockname
takes no arguments. it accesses the listener's getsockname method. see POE::Wheel::SocketFactory for details of the return value. iykyk.
π list_wheels
takes no arguments. returns a list of wheel ids of the currently connected clients. it's the guest list. β¨
π wheel_info
takes one parameter β a wheel ID to query. returns undef if an invalid wheel id is passed (rude, but fair).
- in scalar context: returns the time that the client connected in unix time.
- in list context: returns a list consisting of the peer address, port, the connect time and the lag in seconds for that connection.
yes that's four things in a list. count them. π
π OUTPUT EVENTS π
the plugin emits the following POE::Component::IRC events:
π« irc_proxy_up
emitted when the listener is successfully started. ARG0 is the result of the listener getsockname. we're so up.
π« irc_proxy_connect
emitted when a client connects to the listener. ARG0 is the wheel ID of the client. hi bestie, welcome in. π«Ά
π« irc_proxy_rw_fail
emitted when the POE::Wheel::ReadWrite fails on a connection. ARG0 is the wheel ID of the client. π it happens to the best of us.
π« irc_proxy_authed
emitted when a connecting client successfully negotiates an IRC session with the plugin. ARG0 is the wheel ID of the client. we love a smooth handshake. π
π« irc_proxy_close
emitted when a connected client disconnects. ARG0 is the wheel ID of the client. bye babe, see you next session. π
π« irc_proxy_down
emitted when the listener is successfully shutdown. ARG0 is the result of the listener getsockname. lights off. π
π QUIRKS π
connecting IRC clients will not be able to change nickname.
this is a feature. not a bug. the author said it, I'm just relaying it, no cap. π«π§’
π AUTHOR π
Chris 'BinGOs' Williams. king behaviour, honestly.
π₯ SEE ALSO π₯
POE::Component::IRCPOE::Component::IRC::State
and that's the whole page bestie!! π if you need me I'll be over here binding ports and handing out passwords like party favours. this page shipped with perl v5.40.1, dated 2025-08-21, from the User Contributed Perl Documentation β and that's on periodt. πβ¨π
π¦ where this page comes from
- ubuntu resolute: libpoe-component-irc-perl 6.95+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpoe-component-irc-perl 6.95+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms