Skip to content

Commit e11ec42

Browse files
authored
Merge pull request #43 from libwww-perl/document-ipv6
add "IPv6 SUPPORT" section to pod
2 parents 247e02c + a1de2eb commit e11ec42

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Revision history for HTTP-Daemon
22

33
{{$NEXT}}
44
- In t/chunked.t, leave choosing IP address family to IO::Socket::IP (GH#42) (Shoichi Kaji)
5+
- Add "IPv6 SUPPORT" section to pod (GH#43) (Shoichi Kaji)
56

67
6.07 2020-05-19 19:19:53Z (TRIAL RELEASE)
78
- Prefer IP address for host in $d->url (GH#40) (Shoichi Kaji)

lib/HTTP/Daemon.pm

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,10 @@ listen on a socket for incoming requests. The C<HTTP::Daemon> is a
620620
subclass of C<IO::Socket::IP>, so you can perform socket operations
621621
directly on it too.
622622
623+
Please note that C<HTTP::Daemon> used to be a subclass of C<IO::Socket::INET>.
624+
To support IPv6, it switched the parent class to C<IO::Socket::IP> at version 6.05.
625+
See L</IPv6 SUPPORT> for details.
626+
623627
The accept() method will return when a connection from a client is
624628
available. The returned value will be an C<HTTP::Daemon::ClientConn>
625629
object which is another C<IO::Socket::IP> subclass. Calling the
@@ -863,6 +867,19 @@ Return a reference to the corresponding C<HTTP::Daemon> object.
863867
864868
=back
865869
870+
=head1 IPv6 SUPPORT
871+
872+
Since version 6.05, C<HTTP::Daemon> is a subclass of C<IO::Socket::IP>
873+
rather than C<IO::Socket::INET>, so that it supports IPv6.
874+
875+
For some reasons, you may want to force C<HTTP::Daemon> to listen on IPv4 addresses only.
876+
Then pass C<Family> argument to C<< HTTP::Daemon->new >>:
877+
878+
use HTTP::Daemon;
879+
use Socket 'AF_INET';
880+
881+
my $d = HTTP::Daemon->new(Family => AF_INET);
882+
866883
=head1 SEE ALSO
867884
868885
RFC 2616

0 commit comments

Comments
 (0)