diff --git a/src/WebApi.cpp b/src/WebApi.cpp index 2715e2af..b9d4d192 100644 --- a/src/WebApi.cpp +++ b/src/WebApi.cpp @@ -5,7 +5,7 @@ WebApiClass::WebApiClass() : _server(HTTP_PORT) - , _ws("/ws") + , _ws("/livedata") , _events("/events") { } diff --git a/webapp/src/components/HomeView.vue b/webapp/src/components/HomeView.vue index 152b9eb4..65cbf4f8 100644 --- a/webapp/src/components/HomeView.vue +++ b/webapp/src/components/HomeView.vue @@ -90,7 +90,7 @@ export default { window.location.protocol === "https:" ? "wss:" : "ws:"; const port = window.location.port; const host = window.location.hostname; - const webSocketUrl = socketProtocol + "//" + host + ":" + port + "/ws"; + const webSocketUrl = socketProtocol + "//" + host + ":" + port + "/livedata"; this.connection = new WebSocket(webSocketUrl); diff --git a/webapp/vue.config.js b/webapp/vue.config.js index 02108b62..1538d2a8 100644 --- a/webapp/vue.config.js +++ b/webapp/vue.config.js @@ -24,6 +24,15 @@ module.exports = defineConfig({ } }, devServer: { - proxy: 'http://192.168.20.110/' + proxy: { + '^/api': { + target: 'http://192.168.20.110/' + }, + '^/livedata': { + target: 'ws://192.168.20.110/', + ws: true, + changeOrigin: true + } + } } }) \ No newline at end of file