/dev/null 2>&1'); // Common. $base_cmd = 'nohup "'.$config['gotty'].'"'; $base_cmd .= ' --permit-arguments -a 127.0.0.1 -w '; // Launch gotty - SSH. $cmd = $base_cmd.' --port '.$config['gotty_ssh_port']; $cmd .= ' ssh >> '.__DIR__.'/pandora_console.log 2>&1 &'; shell_exec($cmd); // Launch gotty - telnet. $cmd = $base_cmd.' --port '.$config['gotty_telnet_port']; $cmd .= ' telnet >> '.__DIR__.'/pandora_console.log 2>&1 &'; shell_exec($cmd); } // Start Web SocketProxy. $ws = new WSManager( // Bind address. $config['ws_bind_address'], // Bind port. $config['ws_port'], // Connected handlers. ['gotty' => 'proxyConnected'], // Process handlers. [], // ProcessRaw handlers. ['gotty' => 'proxyProcessRaw'], // Tick handlers. [], $bufferSize, $debug ); try { $ws->run(); } catch (Exception $e) { $ws->stdout($e->getMessage()); }