1
0
mirror of https://github.com/Ylianst/MeshCentralRouter synced 2025-12-10 05:13:39 +00:00

Fix for multi-domain servers.

This commit is contained in:
Ylian Saint-Hilaire
2021-07-08 11:06:12 -07:00
parent f932f9108e
commit 386c706852
4 changed files with 7 additions and 5 deletions

View File

@@ -335,7 +335,8 @@ namespace MeshCentralRouter
bytesOutCompressed = 0;
state = 2;
string u = "*/meshrelay.ashx?p=5&nodeid=" + node.nodeid + "&id=" + randomIdHex + "&rauth=" + server.rauthCookie;
string u = "*" + server.wsurl.AbsolutePath.Replace("control.ashx", "meshrelay.ashx") + "?p=5&nodeid=" + node.nodeid + "&id=" + randomIdHex + "&rauth=" + server.rauthCookie;
server.sendCommand("{ \"action\": \"msg\", \"type\": \"tunnel\", \"nodeid\": \"" + node.nodeid + "\", \"value\": \"" + u.ToString() + "\", \"usage\": 5 }");
displayMessage(null);
break;

View File

@@ -151,7 +151,7 @@ namespace MeshCentralRouter
public void AttachKeyboard()
{
Console.WriteLine(isHookWanted);
//Console.WriteLine(isHookWanted);
if (!keyboardIsAttached && isHookWanted)
{
ControlHook.AttachKeyboardHook(SendKey);

View File

@@ -215,7 +215,8 @@ namespace MeshCentralRouter
bytesOutCompressed = 0;
state = 2;
string u = "*/meshrelay.ashx?p=2&nodeid=" + node.nodeid + "&id=" + randomIdHex + "&rauth=" + server.rauthCookie;
string u = "*" + server.wsurl.AbsolutePath.Replace("control.ashx", "meshrelay.ashx") + "?p=2&nodeid=" + node.nodeid + "&id=" + randomIdHex + "&rauth=" + server.rauthCookie;
server.sendCommand("{ \"action\": \"msg\", \"type\": \"tunnel\", \"nodeid\": \"" + node.nodeid + "\", \"value\": \"" + u.ToString() + "\", \"usage\": 2 }");
displayMessage(null);
break;
@@ -320,7 +321,7 @@ namespace MeshCentralRouter
private void UpdateStatus()
{
if (this.InvokeRequired) { this.Invoke(new UpdateStatusHandler(UpdateStatus)); return; }
if (this.InvokeRequired) { try { this.Invoke(new UpdateStatusHandler(UpdateStatus)); } catch (Exception) { } return; }
//if (kvmControl == null) return;
switch (state)

View File

@@ -347,7 +347,7 @@ namespace MeshCentralRouter
TcpClient client = (TcpClient)sender.tag;
if (client != null) {
sender.Pause(); // Pause reading from the websocket until the data is sent on the TCP client
client.GetStream().BeginWrite(data, offset, length, new AsyncCallback(ClientEndWrite), sender);
try { client.GetStream().BeginWrite(data, offset, length, new AsyncCallback(ClientEndWrite), sender); } catch (Exception) { }
}
}
if ((sender.tag.GetType() == typeof(UdpClient)) && (sender.endpoint != null))