Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore EADDRNOTAVAIL error when listen localhost #33

Merged
merged 1 commit into from
May 16, 2018

Conversation

popomore
Copy link
Member

if localhost refer to the ip that is not unkonwn on the machine, you will see the error EADDRNOTAVAIL

https://stackoverflow.com/questions/10809740/listen-eaddrnotavail-error-in-node-js

if localhost refer to the ip that is not unkonwn on the machine, you will see the error EADDRNOTAVAIL

https://stackoverflow.com/questions/10809740/listen-eaddrnotavail-error-in-node-js
@popomore popomore requested a review from fengmk2 May 16, 2018 06:31
@popomore
Copy link
Member Author

好像不太好模拟

@likezero
Copy link

likezero commented May 16, 2018

为啥不直接去掉localhost的处理呢,或者换成127.0.0.1。

如果直接抛出 EADDRNOTAVAIL 这个错误码,使用者可能还得去查一遍才知道怎么才能解决

@fengmk2
Copy link
Member

fengmk2 commented May 16, 2018

@popomore 可以参考 @likezero 的建议,127.0.0.1 似乎更加合适。

@popomore
Copy link
Member Author

考虑到 localhost 可能配置成其他的,需求和 bug 分开处理。

还有测试绑定 localhost,需要重构下。

@fengmk2 fengmk2 merged commit 64777f8 into master May 16, 2018
@fengmk2 fengmk2 deleted the EADDRNOTAVAIL branch May 16, 2018 13:21
@fengmk2
Copy link
Member

fengmk2 commented May 16, 2018

1.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants