summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Schulthess2017-02-22 14:52:56 +0100
committerChristoph Schulthess2017-02-22 14:52:56 +0100
commit6d02c5b2d326dda26572c99b844c3faee5ad5e5e (patch)
tree13feef3dbc095c22dc6e15c9f49790c08584e915
parentdebugconfig and -request (diff)
downloadslx-admin-6d02c5b2d326dda26572c99b844c3faee5ad5e5e.tar.gz
slx-admin-6d02c5b2d326dda26572c99b844c3faee5ad5e5e.tar.xz
slx-admin-6d02c5b2d326dda26572c99b844c3faee5ad5e5e.zip
debugrequest_TLS added
-rw-r--r--apis/debugrequest_TLS.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/apis/debugrequest_TLS.php b/apis/debugrequest_TLS.php
new file mode 100644
index 00000000..4af386f4
--- /dev/null
+++ b/apis/debugrequest_TLS.php
@@ -0,0 +1,27 @@
+<?php
+$debug_settings = Property::getRemoteDebugConfig();
+if ($debug_settings["enabled"] !== true) {
+ http_response_code(403);
+ exit;
+}
+
+$debug_request = explode(":", file_get_contents("php://input"), 2);
+
+$uuid = $debug_request[0];
+$port = 5900 + $debug_request[1];
+
+$validclient = Database::queryFirst("SELECT machineuuid, clientip FROM machine WHERE machineuuid = :uuid AND clientip = :ip", array(":uuid" => "$debug_request[0]", ":ip" => $_SERVER["REMOTE_ADDR"]));
+
+if ($validclient == false) {
+ http_response_code(400);
+} else {
+ http_response_code(200);
+ $data = array("hosts" => array($_SERVER["REMOTE_ADDR"], $debug_settings["debugServer"]),
+ "ports" => array($port, intval($debug_settings["port"])), "descs" => array("bwlpclient", "debugserver"));
+ $taskstruct = Taskmanager::submit('DispatchSSLRelay', $data);
+ //$taskstruct = Taskmanager::submit('FantasyTask');
+ //$taskstruct = Taskmanager::submit('DummyTask');
+ error_log(print_r($taskstruct, true));
+ Property::setDebugTaskStruct($taskstruct);
+}
+