mirror of
https://github.com/Ylianst/MeshCentralRouter
synced 2025-12-11 05:43:45 +00:00
Support for localport in URL.
This commit is contained in:
10
MainForm.cs
10
MainForm.cs
@@ -218,6 +218,7 @@ namespace MeshCentralRouter
|
|||||||
string autoNodeId = null;
|
string autoNodeId = null;
|
||||||
string autoRemoteIp = null;
|
string autoRemoteIp = null;
|
||||||
int autoRemotePort = 0;
|
int autoRemotePort = 0;
|
||||||
|
int autoLocalPort = 0;
|
||||||
int autoProtocol = 0;
|
int autoProtocol = 0;
|
||||||
int autoAppId = 0;
|
int autoAppId = 0;
|
||||||
bool autoExit = false;
|
bool autoExit = false;
|
||||||
@@ -230,6 +231,8 @@ namespace MeshCentralRouter
|
|||||||
autoProtocol = int.Parse(getValueFromQueryString(authLoginUrl.Query, "protocol"));
|
autoProtocol = int.Parse(getValueFromQueryString(authLoginUrl.Query, "protocol"));
|
||||||
autoAppId = int.Parse(getValueFromQueryString(authLoginUrl.Query, "appid"));
|
autoAppId = int.Parse(getValueFromQueryString(authLoginUrl.Query, "appid"));
|
||||||
autoExit = (getValueFromQueryString(authLoginUrl.Query, "autoexit") == "1");
|
autoExit = (getValueFromQueryString(authLoginUrl.Query, "autoexit") == "1");
|
||||||
|
string localPortStr = getValueFromQueryString(authLoginUrl.Query, "localport");
|
||||||
|
if (localPortStr != null) { autoLocalPort = int.Parse(localPortStr); }
|
||||||
}
|
}
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
if ((autoRemotePort != 0) && (autoProtocol != 0) && (autoNodeId != null)) {
|
if ((autoRemotePort != 0) && (autoProtocol != 0) && (autoNodeId != null)) {
|
||||||
@@ -237,7 +240,7 @@ namespace MeshCentralRouter
|
|||||||
map.Add("nodeId", autoNodeId);
|
map.Add("nodeId", autoNodeId);
|
||||||
if (autoRemoteIp != null) { map.Add("remoteIP", autoRemoteIp); }
|
if (autoRemoteIp != null) { map.Add("remoteIP", autoRemoteIp); }
|
||||||
map.Add("remotePort", autoRemotePort);
|
map.Add("remotePort", autoRemotePort);
|
||||||
map.Add("localPort", 0);
|
map.Add("localPort", autoLocalPort);
|
||||||
map.Add("protocol", autoProtocol);
|
map.Add("protocol", autoProtocol);
|
||||||
map.Add("appId", autoAppId);
|
map.Add("appId", autoAppId);
|
||||||
map.Add("autoExit", autoExit);
|
map.Add("autoExit", autoExit);
|
||||||
@@ -901,6 +904,7 @@ namespace MeshCentralRouter
|
|||||||
string autoNodeId = null;
|
string autoNodeId = null;
|
||||||
string autoRemoteIp = null;
|
string autoRemoteIp = null;
|
||||||
int autoRemotePort = 0;
|
int autoRemotePort = 0;
|
||||||
|
int autoLocalPort = 0;
|
||||||
int autoProtocol = 0;
|
int autoProtocol = 0;
|
||||||
int autoAppId = 0;
|
int autoAppId = 0;
|
||||||
bool autoExit = false;
|
bool autoExit = false;
|
||||||
@@ -913,6 +917,8 @@ namespace MeshCentralRouter
|
|||||||
autoProtocol = int.Parse(getValueFromQueryString(authLoginUrl2.Query, "protocol"));
|
autoProtocol = int.Parse(getValueFromQueryString(authLoginUrl2.Query, "protocol"));
|
||||||
autoAppId = int.Parse(getValueFromQueryString(authLoginUrl2.Query, "appid"));
|
autoAppId = int.Parse(getValueFromQueryString(authLoginUrl2.Query, "appid"));
|
||||||
autoExit = (getValueFromQueryString(authLoginUrl2.Query, "autoexit") == "1");
|
autoExit = (getValueFromQueryString(authLoginUrl2.Query, "autoexit") == "1");
|
||||||
|
string localPortStr = getValueFromQueryString(authLoginUrl.Query, "localport");
|
||||||
|
if (localPortStr != null) { autoLocalPort = int.Parse(localPortStr); }
|
||||||
}
|
}
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
if ((autoRemotePort != 0) && (autoProtocol != 0) && (autoNodeId != null))
|
if ((autoRemotePort != 0) && (autoProtocol != 0) && (autoNodeId != null))
|
||||||
@@ -921,7 +927,7 @@ namespace MeshCentralRouter
|
|||||||
map.Add("nodeId", autoNodeId);
|
map.Add("nodeId", autoNodeId);
|
||||||
if (autoRemoteIp != null) { map.Add("remoteIP", autoRemoteIp); }
|
if (autoRemoteIp != null) { map.Add("remoteIP", autoRemoteIp); }
|
||||||
map.Add("remotePort", autoRemotePort);
|
map.Add("remotePort", autoRemotePort);
|
||||||
map.Add("localPort", 0);
|
map.Add("localPort", autoLocalPort);
|
||||||
map.Add("protocol", autoProtocol);
|
map.Add("protocol", autoProtocol);
|
||||||
map.Add("appId", autoAppId);
|
map.Add("appId", autoAppId);
|
||||||
map.Add("autoExit", autoExit);
|
map.Add("autoExit", autoExit);
|
||||||
|
|||||||
Reference in New Issue
Block a user