From 91cdfc93780d2665fa5de74a0cc770b757a77641 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 11 Nov 2018 20:10:48 +0200 Subject: [PATCH] Fix websockets in dev server proxy --- maubot/management/frontend/package.json | 1 - maubot/management/frontend/src/setupProxy.js | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 maubot/management/frontend/src/setupProxy.js diff --git a/maubot/management/frontend/package.json b/maubot/management/frontend/package.json index 320679b..29e19e0 100644 --- a/maubot/management/frontend/package.json +++ b/maubot/management/frontend/package.json @@ -25,7 +25,6 @@ "last 2 safari versions", "last 2 ios_saf versions" ], - "proxy": "http://localhost:29316", "homepage": ".", "devDependencies": { "sass-lint": "^1.12.1", diff --git a/maubot/management/frontend/src/setupProxy.js b/maubot/management/frontend/src/setupProxy.js new file mode 100644 index 0000000..666772d --- /dev/null +++ b/maubot/management/frontend/src/setupProxy.js @@ -0,0 +1,6 @@ +const proxy = require("http-proxy-middleware") + +module.exports = function(app) { + app.use(proxy("/_matrix/maubot/v1", { target: "http://localhost:29316" })) + app.use(proxy("/_matrix/maubot/v1/logs", { target: "http://localhost:29316", ws: true })) +}