mirror of
https://github.com/Ylianst/MeshCentralRouter
synced 2025-12-16 00:03:28 +00:00
Fixed mapping issue when using ?key=
This commit is contained in:
@@ -67,7 +67,13 @@ namespace MeshCentralRouter
|
|||||||
mapper.inaddrany = inaddrany;
|
mapper.inaddrany = inaddrany;
|
||||||
mapper.certhash = certhash;
|
mapper.certhash = certhash;
|
||||||
mapper.onStateMsgChanged += Mapper_onStateMsgChanged;
|
mapper.onStateMsgChanged += Mapper_onStateMsgChanged;
|
||||||
string serverurl = "wss://" + host + "/meshrelay.ashx?nodeid=" + node.nodeid;
|
string serverurl;
|
||||||
|
int keyIndex = host.IndexOf("?key=");
|
||||||
|
if (keyIndex >= 0) {
|
||||||
|
serverurl = "wss://" + host.Substring(0, keyIndex) + "/meshrelay.ashx?nodeid=" + node.nodeid + "&key=" + host.Substring(keyIndex + 5);
|
||||||
|
} else {
|
||||||
|
serverurl = "wss://" + host + "/meshrelay.ashx?nodeid=" + node.nodeid;
|
||||||
|
}
|
||||||
if (protocol == 1) {
|
if (protocol == 1) {
|
||||||
serverurl += ("&tcpport=" + remotePort);
|
serverurl += ("&tcpport=" + remotePort);
|
||||||
if (remoteIP != null) { serverurl += "&tcpaddr=" + remoteIP; }
|
if (remoteIP != null) { serverurl += "&tcpaddr=" + remoteIP; }
|
||||||
|
|||||||
Reference in New Issue
Block a user