Fixed devServer routes in vue.config.js.

Use `127.0.0.1` instead of `localhost` for the Vue proxy.
This commit is contained in:
Fabio Manganiello 2023-05-12 02:01:13 +02:00
parent cfedcd701e
commit 79871e0fa1
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -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,
}
}
};