mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 11:17:08 +00:00
Rename websocket /ws → /dougal-websocket.
The Webpack dev server seems to really like /ws and ignores any attempts to set a different path, so we just rename our websocket instead.
This commit is contained in:
@@ -31,7 +31,7 @@ new Vue({
|
||||
|
||||
user: null,
|
||||
|
||||
wsUrl: "/ws",
|
||||
wsUrl: "/dougal-websocket",
|
||||
ws: null
|
||||
}
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = {
|
||||
"^/api(/|$)": {
|
||||
target: "http://127.0.0.1:3000",
|
||||
},
|
||||
"^/ws(/|$)": {
|
||||
"^/dougal-websocket(/|$)": {
|
||||
target: "ws://127.0.0.1:3000",
|
||||
ws: true
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ function start (server, pingInterval=30000) {
|
||||
server.on('upgrade', (request, socket, head) => {
|
||||
// console.log("Received upgrade request", request.url);
|
||||
const url = URL.parse(request.url);
|
||||
if (/^\/ws\/?$/.test(url.pathname)) {
|
||||
if (/^\/dougal-websocket\/?$/.test(url.pathname)) {
|
||||
wsServer.handleUpgrade(request, socket, head, socket => {
|
||||
wsServer.emit('connection', socket, request);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user