Skip to content

Commit 15af6c5

Browse files
committed
🐞 fix: 修正部分浏览器无法连接ws的问题
1 parent a66897b commit 15af6c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

game/frontend/src/stores/game.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const useGameStore = defineStore('game', () => {
8888
function initGame(): GameCore{
8989
if (game.value) return game.value as GameCore;
9090

91-
game.value = new GameCore('/ws')
91+
game.value = new GameCore(location.origin.replace(/^http/, 'ws') + '/ws')
9292

9393
return game.value.run()
9494
.on('global.error', (err) => {

0 commit comments

Comments
 (0)