-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
48 lines (41 loc) · 1.02 KB
/
Copy pathserver.js
File metadata and controls
48 lines (41 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env node
const GuacamoleLite = require("guacamole-lite");
const express = require("express");
const https = require("https");
const fs = require("fs");
const cors = require("cors");
const app = express();
app.use(cors());
const PORT = 8081;
const server = https.createServer(
{
key: fs.readFileSync("./privkey.pem"),
cert: fs.readFileSync("./cert.pem"),
},
app
);
const websocketOptions = {
port: PORT, // we will accept connections to this port
};
const guacdOptions = {
port: 4822, // port of guacd
host: "127.0.0.1",
};
const clientOptions = {
crypt: {
cypher: "AES-256-CBC",
key: "MySuperSecretKeyForParamsToken12",
},
log: {
level: "DEBUG",
stdLog: (...args) => {
console.log("[DEBUG]", ...args);
},
errorLog: (...args) => {
console.error("[ERROR]", ...args);
},
},
};
// const guacServer = new GuacamoleLite(websocketOptions, guacdOptions, clientOptions);
const guacServer = new GuacamoleLite({ server }, guacdOptions, clientOptions);
server.listen(PORT);