Get destination addres for UDP in nodejs

networking, node.js, udp

Solution

It is currently not possible.

See this Github bug link

Workaround:

- have different internal ports for the broadcast and the normal traffic.

- Use iptables to redirect broadcast traffic to one of the internal port and the other traffic to the other port.

Problem

My server listens on a UDP port and also receives broadcast messages. Can I detect somehow if the received message was sent to my ip directly or to a broadcast address? `rinfo` just gives me the sender information

Original source