socket path is now relative to domain (but not to directory in domain)
This commit is contained in:
parent
1beeb9fdbc
commit
ac813064fd
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
const tavern = {
|
const tavern = {
|
||||||
socket: socket = new WebSocket('ws://localhost:3001/ws'),
|
socket: socket = new WebSocket('ws:/' + window.location.host + '/ws'),
|
||||||
connected: false,
|
connected: false,
|
||||||
loggedIn: false,
|
loggedIn: false,
|
||||||
call: (f, ...args) => {
|
call: (f, ...args) => {
|
||||||
|
@ -41,4 +41,4 @@ tavern.get_chat_history = (from, amount) => {
|
||||||
tavern.get_last_msgs = (amount) => {
|
tavern.get_last_msgs = (amount) => {
|
||||||
if(!tavern.connected || tavern.loggedIn) { return false; }
|
if(!tavern.connected || tavern.loggedIn) { return false; }
|
||||||
tavern.socket.send(JSON.stringify({ get_last_messages: { amount: amount } }))
|
tavern.socket.send(JSON.stringify({ get_last_messages: { amount: amount } }))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue