Files

17 lines
698 B
JavaScript

const { RemoteTerminal } = require('./remote_exec');
async function main() {
const term = new RemoteTerminal('wss://soc-tester-9b6540e2d4ed.hosted.ghaymah.systems/ws');
await term.connect();
console.log('Writing /tmp/test_ui.html in soc-tester...');
await term.exec("echo 'TEST_HTML_SOC_ONLINE' > /tmp/test_ui.html");
console.log('Starting ttyd on port 7682 with custom index...');
await term.exec('ttyd -p 7682 -I /tmp/test_ui.html bash > /dev/null 2>&1 &');
await new Promise(r => setTimeout(r, 1200));
const res = await term.exec('wget -qO- http://localhost:7682/');
console.log('Wget output from port 7682:\n', res.output);
process.exit(0);
}
main().catch(console.error);