On Wed, Feb 1, 2012 at 8:50 AM, Kazu Yamamoto <
kazu.yamamoto-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi,
>
> It appeared that 1) is the same as 2). autoreconf generates
>
HsNetworkConfig.h.in.
>
> To my surprise, it also appeared that the basic function setSocketOptions is
> buggy. See:
>
>
https://github.com/haskell/network/pull/23
>
> --Kazu
>
>
> On Wed, Feb 1, 2012 at 10:53 AM, Kazu Yamamoto <
kazu.yamamoto-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> wrote:
>>
>> I think I understand this issue completely.
>>
>> The latest network package has two problems:
>>
>> 1) "include/
HsNetworkConfig.h.in" does not have HAVE_DECL_IPV6_V6ONLY.
>> So, this macro is never enabled. This is my fault. I forget to include
>> this when
>> I sent the pull request to the network package.
>>
>> 2) "configure" is not re-generated. So, even if
>> include/
HsNetworkConfig.h.in has
>> the macro, IPV6_V6ONLY option is not detected when "cabal configure".
>>
>> I will fix this and sent pull request to the network package.
>>
>> Sorry for your inconvenience.
>>
>> --Kazu
>>
>>
>> On Tue, Jan 31, 2012 at 6:35 PM, Michael Snoyman <
michael-cq0OxgmGHj5BDgjK7y7TUQ@public.gmane.org>
>> wrote:
>>>
>>> On Tue, Jan 31, 2012 at 11:30 AM, Erik de Castro Lopo
>>> <
mle+hs <at> mega-nerd.com> wrote:
>>> > Kazu Yamamoto wrote:
>>> >
>>> >> > - Does Yesod app bind to ::1?
>>> >> >
>>> >> > Yes.
>>> >> >
>>> >>
>>> >> I guess this is the cause of this problem.
>>> >>
>>> >> Even if ipv6_v6only is true, your network package turns it false. So,
>>> >> if
>>> >> you listens to all zero address, both IPv4 and IPv6 can be accepted.
>>> >>
>>> >> However, you specify IPv6's ::1 only. So, you cannot accept 1IPv4's
>>> >> 27.0.0.1. Why do you bind to ::1 instead of all zero address ?
>>> >
>>> > I am not specify the port, just getting whatever is the default.
>>> > I am running the example from the Yesod book:
>>> >
>>> > main :: IO ()
>>> > main = warpDebug 3000 HelloWorld
>>> >
>>> > Erik
>>> > --
>>> > ----------------------------------------------------------------------
>>> > Erik de Castro Lopo
>>> >
http://www.mega-nerd.com/
>>>
>>> Hi Kazu,
>>>
>>> If you look at this commit[1], it changed the behavior of Warp to
>>> always select IPv6 addresses over IPv4. I think that's been the source
>>> of the issue. Your notes say that using the IPv6 address would allow
>>> it to work with either v4 or v6, but that doesn't seem to be working
>>> on all OSes.
>>>
>>> Perhaps we should change it so that there are two "special" host
>>> values: "*" means bind to a v4 address, and "::1" means to bind to a
>>> v6 address. We'll keep "*" as the default, hopefully solving Erik's
>>> issue (and many other users). For people wanting to host a server over
>>> v4 or v6, they need to pass in the extra "::1" parameter.
>>>
>>> Michael
>>>
>>> [1]
>>>
https://github.com/yesodweb/wai/commit/02c1396c86e3fceb48cbe7df58cb631c804e24d4
>>
>>
>