Skip to content

dgram: follow the same standard of net for the default address #5487

Closed
@mcollina

Description

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

Metadata

Assignees

No one assigned

    Labels

    dgramIssues and PRs related to the dgram subsystem / UDP.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions