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:
D. Berge
2023-11-02 11:39:49 +01:00
parent 7dee457fa1
commit 4a8d3a99c1
3 changed files with 4 additions and 4 deletions

View File

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