Rename websocket from ws to livedata
Allows devServer to proxy websockets as well...
This commit is contained in:
parent
46d88c6520
commit
17cc2a475d
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
WebApiClass::WebApiClass()
|
WebApiClass::WebApiClass()
|
||||||
: _server(HTTP_PORT)
|
: _server(HTTP_PORT)
|
||||||
, _ws("/ws")
|
, _ws("/livedata")
|
||||||
, _events("/events")
|
, _events("/events")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@ -90,7 +90,7 @@ export default {
|
|||||||
window.location.protocol === "https:" ? "wss:" : "ws:";
|
window.location.protocol === "https:" ? "wss:" : "ws:";
|
||||||
const port = window.location.port;
|
const port = window.location.port;
|
||||||
const host = window.location.hostname;
|
const host = window.location.hostname;
|
||||||
const webSocketUrl = socketProtocol + "//" + host + ":" + port + "/ws";
|
const webSocketUrl = socketProtocol + "//" + host + ":" + port + "/livedata";
|
||||||
|
|
||||||
this.connection = new WebSocket(webSocketUrl);
|
this.connection = new WebSocket(webSocketUrl);
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,15 @@ module.exports = defineConfig({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
devServer: {
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Loading…
Reference in New Issue
Block a user