#!/usr/bin/perl use lib qw( lib ); use Gtk2 -init; use Gtk2::TrayIcon; use POE::Kernel { loop => "Glib" }; use Sprocket qw( Server Plugin::HTTP::Server Plugin::HTTP::Deny ); use POE; my %opts = ( LogLevel => 4, TimeOut => 0, # MaxConnections => 10000, ); # http server Sprocket::Server->spawn( %opts, Name => 'HTTP Server', ListenPort => 8002, ListenAddress => '0.0.0.0', Plugins => [ { Plugin => Sprocket::Plugin::HTTP::Server->new( DocumentRoot => $ENV{PWD}.'/html', ForwardList => { qr|/\.| => 'HTTP::Deny', }, _ForwardList => [ { qr => qr|/\.|, uuid => 'bc9d2336-1df1-11dc-b49f-bf28de8a957e', name => 'HTTP::Deny' }, ] ), Priority => 0, }, { Plugin => Sprocket::Plugin::HTTP::Deny->new(), Priority => 1, }, ], ); POE::Session->create(inline_states => { _start => sub { my $icon = $_[HEAP]->{icon} = Gtk2::TrayIcon->new( "POE" ); my $label = Gtk2::Label->new( "POE" ); $icon->add( $label ); $icon->show_all; $icon->send_message(3000, "POE App started"); }, }); $poe_kernel->run(); 1;