Add base path to socket.io connections on client and server

This commit is contained in:
mikiher 2024-10-15 05:50:23 +03:00
parent 42616b59de
commit 2d7b63b4cf
2 changed files with 4 additions and 2 deletions

View File

@ -357,7 +357,8 @@ export default {
teardown: false, teardown: false,
transports: ['websocket'], transports: ['websocket'],
upgrade: false, upgrade: false,
reconnection: true reconnection: true,
path: `${this.$config.routerBasePath}/socket.io`
}) })
this.$root.socket = this.socket this.$root.socket = this.socket
console.log('Socket initialized') console.log('Socket initialized')

View File

@ -103,7 +103,8 @@ class SocketAuthority {
cors: { cors: {
origin: '*', origin: '*',
methods: ['GET', 'POST'] methods: ['GET', 'POST']
} },
path: `${global.RouterBasePath}/socket.io`
}) })
this.io.on('connection', (socket) => { this.io.on('connection', (socket) => {