ws relative url only path.
This commit is contained in:
parent
79e817e0b2
commit
b75303aa30
@ -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)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user