Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (23 sloc) 0.477 kb
use strict;
use warnings;
use AnyEvent::Impl::EV;
use AE;
use Getopt::Long;
use AnyEvent::Socket;
use AnyEvent::Handle;
my $port = 9010;
GetOptions(
'port=i' => \$port,
);
print "$0: http://localhost:$port/\n";
tcp_server undef, $port, sub {
my ($fh, $host, $port) = @_;
my $sock = AnyEvent::Handle->new(fh => $fh);
$sock->on_read(
sub {
$sock->push_write($_[0]->{rbuf});
$_[0]->{rbuf} = '';
}
);
};
AE::cv->recv;
Jump to Line
Something went wrong with that request. Please try again.