ws relative url only path.

This commit is contained in:
m1k1o 2021-03-10 23:10:14 +01:00
parent 79e817e0b2
commit b75303aa30

View File

@ -34,7 +34,7 @@ export class NekoClient extends BaseClient implements EventEmitter<NekoEvents> {
const url = const url =
process.env.NODE_ENV === 'development' process.env.NODE_ENV === 'development'
? `ws://${location.host.split(':')[0]}:${process.env.VUE_APP_SERVER_PORT}/ws` ? `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) this.initWithURL(vue, url)
} }