more tweeks

This commit is contained in:
Craig
2020-01-13 23:12:55 +00:00
parent c85abb3b63
commit 5830f92637
15 changed files with 81 additions and 118 deletions

1
client/.env.development Normal file
View File

@ -0,0 +1 @@
NEKO_DEV=localhost:3000

View File

@ -470,12 +470,10 @@
}
connect() {
/*
this.ws = new WebSocket(
`${/https/gi.test(location.protocol) ? 'wss' : 'ws'}://${location.host}/ws?password=${this.password}`,
process.env.NODE_ENV === 'development' ? `ws://${process.env.NEKO_DEV}/ws?password=${this.password}` : `${/https/gi.test(location.protocol) ? 'wss' : 'ws'}://${location.host}/ws?password=${this.password}` ,
)
*/
this.ws = new WebSocket(`ws://localhost:3000/ws?password=${this.password}`)
this.ws.onmessage = this.onMessage.bind(this)
this.ws.onerror = event => console.error((event as ErrorEvent).error)
this.ws.onclose = event => this.onClose.bind(this)