diff --git a/MapUserControl.cs b/MapUserControl.cs index 2b363b5..94477e6 100644 --- a/MapUserControl.cs +++ b/MapUserControl.cs @@ -67,7 +67,13 @@ namespace MeshCentralRouter mapper.inaddrany = inaddrany; mapper.certhash = certhash; 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) { serverurl += ("&tcpport=" + remotePort); if (remoteIP != null) { serverurl += "&tcpaddr=" + remoteIP; }