dgram: default send address to 127.0.0.1 or ::1
Pull Request check-list
-
Does make -j8 test
(UNIX) orvcbuild test nosign
(Windows) pass with this change (including linting)? -
Is the commit message formatted according to [CONTRIBUTING.md][0]? -
If this change fixes a bug (or a performance problem), is a regression test (or a benchmark) included? -
Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
Affected core subsystem(s)
dgram
Description of change
In net we default to 'localhost' as the default address for connect. Not doing the same on dgram is confusing, because sending to 0.0.0.0 works on Linux/OS X but not on Windows. Defaulting that to 127.0.0.1 / ::1 addresses that.
Related: https://github.com/nodejs/node/pull/5407 Related: https://github.com/nodejs/node/issues/5398
Fixes: https://github.com/nodejs/node/issues/5487
cc @mafintosh @rvagg @cjihrig @saghul @feross @silverwind