Yesod devel server only listening on ipv6

安稳与你 提交于 2019-12-07 06:36:47

问题


I'm running "cabal install && yesod devel" using yesod 0.9.2.2 but it is only listening using ipv6. Does anyone know how to configure it to listen on ipv4 as well? I'm running it on Windows 7.

Thanks


回答1:


The symptom you describe have so far been observed on BSD and Debian, but it looks like Windows is also affected.

It is a known problem with Yesod, or actually with Wasp, or, to be precise, with the network library. One place to follow up on this issue is this githup issue or the current discussion on haskell-lists, which was partly caused by your question.




回答2:


While I don't currently have a similar setup to test this, you will probably find that if something is listening to IPv6 port X, and there is nothing listening on the same port X for IPv4, then the IPv6 port will receive the connection. The IPv6 server will see a connection coming from "IPv6" address ::ffff:1.2.3.4 (this is called an IPv4 Mapped IPv6 address). The kernel provides the translation between the IPv6 and IPv4 endpoints. IPv4 is used over the wire.

I don't know about Windows 7, but some systems (eg. some Linux distributions) will by default disable this feature by setting a particular sysctl, which would mean that the server would need to bind to separate IPv4 and IPv6 sockets (which is, in my experience, the preferable option). Applications are free to override this default behaviour.



来源:https://stackoverflow.com/questions/7486257/yesod-devel-server-only-listening-on-ipv6

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!