Resolve WAN address using STUN if the PC is discovered over mDNS

This commit is contained in:
Cameron Gutman
2018-10-26 20:44:51 -07:00
parent 2a8dfd63da
commit 48d8a53cd6

View File

@@ -2,6 +2,9 @@
#include "nvhttp.h"
#include "settings/streamingpreferences.h"
#include <Limelight.h>
#include <QtEndian>
#include <QThread>
#include <QThreadPool>
@@ -573,6 +576,12 @@ private:
// Update addresses depending on the context
if (m_Mdns) {
newComputer->localAddress = m_Address;
// Get the WAN IP address using STUN if we're on mDNS
quint32 addr;
if (LiFindExternalAddressIP4("stun.stunprotocol.org", 3478, &addr) == 0) {
newComputer->remoteAddress = QHostAddress(qFromBigEndian(addr)).toString();
}
}
else {
newComputer->manualAddress = m_Address;