guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (web server) serving on both ipv6 and ipv4?


From: Greg Troxel
Subject: Re: (web server) serving on both ipv6 and ipv4?
Date: Thu, 20 Jan 2022 08:38:42 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (berkeley-unix)

"Dr. Arne Babenhauserheide" <arne_bab@web.de> writes:

> Greg Troxel <gdt@lexort.com> writes:
>
>> [[PGP Signed Part:Signature made by expired key 1FDA7AE8098ED60E Gregory D. 
>> Troxel (low security, at work) <gdt@work.lexort.com>]]
>>
>> Maxime Devos <maximedevos@telenet.be> writes:
>>
>>> Maybe the IPV6_V6ONLY (see the ipv6(7) man page) is relevant here.
>>> Alternatively, you could run two servers in parallel: one bound to an
>>> IPv4 address and another bound to an IPv6 address.
>>
>> My feeling is that IPV6_ONLY is best avoided, for portability, and
>> because mapped addresses (an IPv6 address with the v4 address embedded)
>> are awkward.    So I think it's best to listen on v4 and v6 separately.
>
> I see portability, but for simplicity and having the same codebase, I
> think that IPV6_V6ONLY=0 is the right choice.

Make sure you add to your example pulling out the IPv4 address of
connections and logging it reasonably (as a v4 address).  I think it
won't be so simple.

> It is possible to listen both on v6 and v4 for the same port, but you’ll
> then have more complexity — I’m mainly thinking about tutorials here:
> You’ll have to explain a lot more if you have to take care of v6 vs. v4
> instead of having a library that does both.

It's creating two sockets instead of one.  A program that really works
as to be able to do that anyway, because the user should be able to
configure listen addresses to listen on some interfaces and not others.

I also don't follow "library that does both".  If a library has an
option to create one socket, it should be extendable to do both in some
straightforward way.

My experience is that programs that are structured to allow multiple
sockets are easy to make work, and those that don't end up awkward in
various ways,  so I'm encouraging you to address that root cause early.

> An alternative could be a server using the fiberized web server to be
> able to tie efficiently into the rest of the code via a plain fibers
> channel.

That sounds like what should really be addressed; the frameworks should
allow "add this socket, add this other socket" and that should all be
natural.   Whether it's two interface addresses v4 only, or v4/v6, or
v4, v6 and some future protocol.   (BSD kernels used to have ISO and IPX
at some point, and there's no V6ONLY type hack for those.)

Thanks for listening...
Greg

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]