Yesod devel server only listening on ipv6

我只是一个虾纸丫 提交于 2019-12-05 12:43:14

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.

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.

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