In dgram, if you omit the address in send (https://nodejs.org/api/dgram.html#dgram_socket_send_msg_offset_length_port_address_callback), message is sent to '0.0.0.0' or '::0' whereas in net the default address for net.connect is 'localhost' (https://nodejs.org/api/net.html#net_net_connect_options_connectlistener).
This behavior has been around since forever, making dgram.send default address not reliable (see #5407 (comment)).
I propose to reconcile this two behavior, having dgram default to 'localhost' as well.
This will be a semver-major change.
cc @silverwind @rvagg @mafintosh @feross
In dgram, if you omit the
addressin send (https://nodejs.org/api/dgram.html#dgram_socket_send_msg_offset_length_port_address_callback), message is sent to'0.0.0.0'or'::0'whereas in net the default address fornet.connectis'localhost'(https://nodejs.org/api/net.html#net_net_connect_options_connectlistener).This behavior has been around since forever, making
dgram.senddefault address not reliable (see #5407 (comment)).I propose to reconcile this two behavior, having
dgramdefault to'localhost'as well.This will be a semver-major change.
cc @silverwind @rvagg @mafintosh @feross