cscg24-guacamole

CSCG 2024 Challenge 'Guacamole Mashup'
git clone https://git.sinitax.com/sinitax/cscg24-guacamole
Log | Files | Refs | sfeed.txt

main.js (867B)


      1const GuacamoleLite = require('guacamole-lite');
      2
      3const websocketOptions = {
      4    port: 8082 // WebSocket server port
      5};
      6
      7var guacd_hostname = "";
      8
      9if(process.env.SESSIONID) { 
     10    guacd_hostname = "localhost";
     11    console.log("Prod environment");
     12}
     13else {
     14    guacd_hostname = "guac-guacd";
     15    console.log("Local environment");
     16}
     17const guacdOptions = {
     18    host: guacd_hostname,
     19    port: 4822 // guacd server port
     20};
     21
     22const clientOptions = {
     23    crypt: {
     24        cypher: 'AES-256-CBC',
     25        key: 'https://en.wikipedia.org/wiki/Se'
     26        //key: 'x9h9Ab3Bhz0LTleMygDVQQvkqWocr5EV'
     27    }
     28};
     29
     30const guacServer = new GuacamoleLite(websocketOptions, guacdOptions, clientOptions);
     31guacServer.on('error', (clientConnection, error) => {
     32    console.error(`Error on connection ID: ${clientConnection.connectionId}`, error);
     33    // Additional error handling logic...
     34});