From b75303aa30f80c1e13cc5161d8d7404b9d25f0df Mon Sep 17 00:00:00 2001 From: m1k1o Date: Wed, 10 Mar 2021 23:10:14 +0100 Subject: [PATCH] ws relative url only path. --- client/src/neko/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/neko/index.ts b/client/src/neko/index.ts index 6ef7dd4a..d5058a6c 100644 --- a/client/src/neko/index.ts +++ b/client/src/neko/index.ts @@ -34,7 +34,7 @@ export class NekoClient extends BaseClient implements EventEmitter { const url = process.env.NODE_ENV === 'development' ? `ws://${location.host.split(':')[0]}:${process.env.VUE_APP_SERVER_PORT}/ws` - : location.href.replace(/^http/, 'ws').replace(/\/$/, '')+'/ws' + : location.protocol.replace(/^http/, 'ws') + '//' + location.host + location.pathname.replace(/\/$/, '') + '/ws' this.initWithURL(vue, url) }