Bridge a UDP Port Packets from External/Internal world to ChromeOS Linux VM/Container or Another local or remote IP entity
Bridge/Forward UDP packets from outside a Chromebook / ChromeOS (nothing stops it from being a internal entity either)
into a internal Linux/VMs/Containers and or a External networked entity by specifying the IP address of the destination.
Especially Useful if one wants to run a udp based server logic inside a VM/Container under ChromeOS.
This runs locally on the Chrome OS / Chromebook. So it can even run offline.
The port specified for bridging/forwarding is monitored and packets received on it inturn will be sent to the specified bridging dest ip. The port to which it will be sent will be the same specified bridging port.
THere is logic to join and later leave a multicast group/ip. This is to help receive multicast packets if any sent to the bridging port.
One requires to have started the bridging logic before trying to join and leave mcast group/ip. By default the local ip to which the socket is bound is 0.0.0.0, however a user can change it if required. Currently not sure if ChromeOS's chrome.sockets.udp logic uses the local ip specified for the socket to help decide over which local network interface the mcast join and leave requests should be sent.
The following limitations exist:
a) As this uses normal UDP sockets and not raw sockets, so the bridged / forwarded UDP packet's source ip and port may get replaced with the ChromeOS's IP potentially related to the path used for routing into the VM/Container/Networked ENtity.