mirror of
https://github.com/moonlight-stream/Internet-Hosting-Tool.git
synced 2026-06-18 14:41:04 +00:00
Test using the relay even if we believe it may be a double-NAT configuration
This commit is contained in:
+7
-10
@@ -890,15 +890,7 @@ int main(int argc, char* argv[])
|
|||||||
// Try to connect via WAN IPv4 address
|
// Try to connect via WAN IPv4 address
|
||||||
fprintf(LOG_OUT, "Testing GameStream ports via STUN-reported WAN address\n");
|
fprintf(LOG_OUT, "Testing GameStream ports via STUN-reported WAN address\n");
|
||||||
if (!TestAllPorts(&ss, portMsgBuf, sizeof(portMsgBuf), true)) {
|
if (!TestAllPorts(&ss, portMsgBuf, sizeof(portMsgBuf), true)) {
|
||||||
|
|
||||||
RelayCheck:
|
RelayCheck:
|
||||||
// Many UPnP devices report IGD disconnected when double-NATed. If it was really offline,
|
|
||||||
// we probably would not have even gotten past STUN.
|
|
||||||
if (IsDoubleNAT(&locallyReportedWanAddr) || igdDisconnected) {
|
|
||||||
snprintf(msgBuf, sizeof(msgBuf), "Your router appears be connected to the Internet through another router. Click the Help button for guidance on fixing this issue.");
|
|
||||||
DisplayMessage(msgBuf, "https://github.com/moonlight-stream/moonlight-docs/wiki/Internet-Streaming-Errors#connected-through-another-router-error");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
struct addrinfo hint = {};
|
struct addrinfo hint = {};
|
||||||
struct addrinfo* result;
|
struct addrinfo* result;
|
||||||
|
|
||||||
@@ -943,7 +935,13 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
freeaddrinfo(result);
|
freeaddrinfo(result);
|
||||||
|
|
||||||
if (IsPossibleCGN(&locallyReportedWanAddr)) {
|
// Many UPnP devices report IGD disconnected when double-NATed. If it was really offline,
|
||||||
|
// we probably would not have even gotten past STUN.
|
||||||
|
if (IsDoubleNAT(&locallyReportedWanAddr) || igdDisconnected) {
|
||||||
|
snprintf(msgBuf, sizeof(msgBuf), "Your router appears be connected to the Internet through another router. Click the Help button for guidance on fixing this issue.");
|
||||||
|
DisplayMessage(msgBuf, "https://github.com/moonlight-stream/moonlight-docs/wiki/Internet-Streaming-Errors#connected-through-another-router-error");
|
||||||
|
}
|
||||||
|
else if (IsPossibleCGN(&locallyReportedWanAddr)) {
|
||||||
snprintf(msgBuf, sizeof(msgBuf), "Your ISP is running a Carrier-Grade NAT that is preventing you from hosting services like Moonlight on the Internet. Click the Help button for guidance on fixing this issue.");
|
snprintf(msgBuf, sizeof(msgBuf), "Your ISP is running a Carrier-Grade NAT that is preventing you from hosting services like Moonlight on the Internet. Click the Help button for guidance on fixing this issue.");
|
||||||
DisplayMessage(msgBuf, "https://github.com/moonlight-stream/moonlight-docs/wiki/Internet-Streaming-Errors#carrier-grade-nat-error");
|
DisplayMessage(msgBuf, "https://github.com/moonlight-stream/moonlight-docs/wiki/Internet-Streaming-Errors#carrier-grade-nat-error");
|
||||||
}
|
}
|
||||||
@@ -951,7 +949,6 @@ int main(int argc, char* argv[])
|
|||||||
snprintf(msgBuf, sizeof(msgBuf), "Internet GameStream connectivity check failed. Click the Help button for guidance on fixing this issue.\n\nThe following ports were not forwarded properly:\n%s", portMsgBuf);
|
snprintf(msgBuf, sizeof(msgBuf), "Internet GameStream connectivity check failed. Click the Help button for guidance on fixing this issue.\n\nThe following ports were not forwarded properly:\n%s", portMsgBuf);
|
||||||
DisplayMessage(msgBuf, "https://github.com/moonlight-stream/moonlight-docs/wiki/Internet-Streaming-Errors#internet-gamestream-connectivity-check-error");
|
DisplayMessage(msgBuf, "https://github.com/moonlight-stream/moonlight-docs/wiki/Internet-Streaming-Errors#internet-gamestream-connectivity-check-error");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user