It looks like we currently have almost the same IP discovery code in the host and gateway, except that the gateway now has a decentralized way to do it.
We might be able to simply put the gateway IP discovery code into a publicIP method and have an exported PublicIP method that gets called by the host instead of using it's own code.
After that is done a good followup PR might be to also deduplicate the UPnP code of the host.
It looks like we currently have almost the same IP discovery code in the host and gateway, except that the gateway now has a decentralized way to do it. We might be able to simply put the gateway IP discovery code into a
publicIP
method and have an exportedPublicIP
method that gets called by the host instead of using it's own code.After that is done a good followup PR might be to also deduplicate the UPnP code of the host.