From ac813064fd5a351739d04812bf1de2a741b2e57a Mon Sep 17 00:00:00 2001 From: Rusty Striker Date: Fri, 4 Oct 2024 14:44:10 +0300 Subject: [PATCH] socket path is now relative to domain (but not to directory in domain) --- assets/web/socket.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/web/socket.js b/assets/web/socket.js index d660fab..d68ca6f 100644 --- a/assets/web/socket.js +++ b/assets/web/socket.js @@ -1,5 +1,5 @@ const tavern = { - socket: socket = new WebSocket('ws://localhost:3001/ws'), + socket: socket = new WebSocket('ws:/' + window.location.host + '/ws'), connected: false, loggedIn: false, call: (f, ...args) => { @@ -41,4 +41,4 @@ tavern.get_chat_history = (from, amount) => { tavern.get_last_msgs = (amount) => { if(!tavern.connected || tavern.loggedIn) { return false; } tavern.socket.send(JSON.stringify({ get_last_messages: { amount: amount } })) -} \ No newline at end of file +}