Subject: | patch for specifying the host to the tcpserver |
Here's a patch for supporting the "host" parameter, which gets passed to
tcp_server. I didn't want a public web server, just a localhost one, and
that was the only way to do it.
Index: C:/Documents and Settings/mlongtin/My
Documents/dbpro/svn/branches/newscheduler/lib/AnyEvent/HTTPD/HTTPServer.pm
===================================================================
--- C:/Documents and Settings/mlongtin/My
Documents/dbpro/svn/branches/newscheduler/lib/AnyEvent/HTTPD/HTTPServer.pm
(revision 383)
+++ C:/Documents and Settings/mlongtin/My
Documents/dbpro/svn/branches/newscheduler/lib/AnyEvent/HTTPD/HTTPServer.pm
(revision 384)
@@ -36,7 +36,7 @@
my $self = { @_ };
bless $self, $class;
- tcp_server undef, $self->{port}, sub {
+ tcp_server $self->{host}, $self->{port}, sub {
my ($fh) = @_;
unless ($fh) {
$self->event (error => "couldn't accept client: $!");
Index: C:/Documents and Settings/mlongtin/My
Documents/dbpro/svn/branches/newscheduler/lib/AnyEvent/HTTPD.pm
===================================================================
--- C:/Documents and Settings/mlongtin/My
Documents/dbpro/svn/branches/newscheduler/lib/AnyEvent/HTTPD.pm
(revision 383)
+++ C:/Documents and Settings/mlongtin/My
Documents/dbpro/svn/branches/newscheduler/lib/AnyEvent/HTTPD.pm
(revision 384)
@@ -95,6 +95,11 @@
=over 4
+=item host => $host
+
+The TCP address of the HTTP server will listen on. Usually 0.0.0.0 (the
+default), for a public server, or 127.0.0.1 for a local server.
+
=item port => $port
The TCP port the HTTP server will listen on.