From 79871e0fa1b9964f5d28002a68f19a3c20cc08c6 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 12 May 2023 02:01:13 +0200 Subject: [PATCH] Fixed devServer routes in vue.config.js. Use `127.0.0.1` instead of `localhost` for the Vue proxy. --- platypush/backend/http/webapp/vue.config.js | 24 ++++++++------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/platypush/backend/http/webapp/vue.config.js b/platypush/backend/http/webapp/vue.config.js index b4db0f658..2fc90a107 100644 --- a/platypush/backend/http/webapp/vue.config.js +++ b/platypush/backend/http/webapp/vue.config.js @@ -1,16 +1,14 @@ const httpProxy = { - target: 'http://localhost:8008', + target: 'http://127.0.0.1:8008', changeOrigin: true } const wsProxy = { - target: 'http://localhost:8008', + target: 'http://127.0.0.1:8008', changeOrigin: false, ws: true, onProxyReq: function(request) { - console.log('===== HERE'); - console.log(request); - request.setHeader('Origin', 'http://localhost:8008'); + request.setHeader('Origin', 'http://127.0.0.1:8008'); }, } @@ -31,16 +29,12 @@ module.exports = { devServer: { proxy: { - '/execute': httpProxy, - '/ws/events': wsProxy, - '/ws/requests': wsProxy, - '/static/*': httpProxy, - '/auth': httpProxy, - '/login': httpProxy, - '/logout': httpProxy, - '/register': httpProxy, - '/camera/*': httpProxy, - '/sound/*': httpProxy, + '^/ws/events': wsProxy, + '^/ws/requests': wsProxy, + '^/execute': httpProxy, + '^/auth': httpProxy, + '^/camera/': httpProxy, + '^/sound/': httpProxy, } } };