Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Get destination address of UDP packet #6589

Description

@huysentruitw

We're porting C# code to NodeJS and found something is missing in the Node datagram API.

In C# we're using Socket.ReceiveMessageFrom to receive the datagram. In addition to the remote end point, we also get the IPPacketInformation which contains the destination address of the packet (== address of local interface that received the packet).

In C# we use this method to get connected with a 3rd party device:

  1. we set up a UDP socket that's bound to IPAddress.Any
  2. then we receive a discovery packet from the 3rd party device on one of the interfaces
  3. we need to send back the local IP address of the interface where the packet arrived on, so the 3rd party device can initiate a TCP/IP connection to it.

Is there a way to achieve the same using the Node datagram API?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions