A simple php web terminal application with laravel support.
composer require tiran133/phpwebtermrequire__DIR__.'/../vendor/autoload.php';
$config = [
'port' => 8034,
'listen' => '0.0.0.0',
'scheme' => 'http',
// SSL/TLS context'certificate' => [
'local_cert' => 'server.crt',
'local_pk' => 'server.key',
'passphrase' => '',
],
];
//Create new websocket server$websocketServe = newServer(newServerConfig($config));
// Add route: Uses a simple approach to spawn the process.$websocketServe->addRoute('/server-shell', ServerShellProcess::class);
//Startwebsocket server$websocketServe->start();import{TerminalManager}from'/../dist/TerminalManager.es.js';// If the config is not supplied, it will read the config from ENV variable during vite build processconstconfig={WEBSOCKET_SCHEME: 'http',WEBSOCKET_HOST: '127.0.0.1',WEBSOCKET_PORT: '8034',}// Instantiate and expose the managerconstterminalManager=newTerminalManager(config);window.connectServerShell=terminalManager.newEndpoint('server-shell');// Opens a shell to a serverwindow.connectServerShell({host: '<IP>',port: 22,username: 'dashboard',jump_proxy: '<USER>@<IP>:<PORT>',ssh_key_path: '<PATH TO FILE>'});See example directory for more details.