guacamole url

This commit is contained in:
Manuel Romero
2024-10-26 06:24:06 +02:00
parent d879849625
commit 00a42b084c

View File

@@ -39,6 +39,7 @@ const passport = require('./passport-okta');
const QMI_MONGO_URL = process.env.QMI_MONGO_URL || "http://host.docker.internal:8081/";
const BACKEND_LOGS_URL = process.env.BACKEND_LOGS_URL || "http://host.docker.internal:8888/";
const GUACAMOLE_URL = process.env.GUACAMOLE_URL || "http://qmicloud-dev.qliktech.com:8080/guacamole/";
const IS_SECURE = process.env.CERT_PFX_PASSWORD && process.env.CERT_PFX_FILENAME;
@@ -129,12 +130,13 @@ passport.init(app, IS_SECURE ? true : false);
GUACAMOLE
*/
app.use('/guacamole/', passport.ensureAuthenticatedAndVPNDoLogin, createProxyMiddleware({
target: 'http://qmicloud-dev.qliktech.com:8080/guacamole/',
target: GUACAMOLE_URL,
ws: true,
changeOrigin: true,
followRedirects: true,
secure: false,
onProxyReq: function (proxyReq, req, res) {
console.log("Guac User", req.user);
if (req.user && req.user.mail) {
proxyReq.setHeader('X-Guaca-Auth', req.user.mail);
}