socket path is now relative to domain (but not to directory in domain)

This commit is contained in:
Rusty Striker 2024-10-04 14:44:10 +03:00
parent 1beeb9fdbc
commit ac813064fd
Signed by: RustyStriker
GPG key ID: 9DBDBC7C48FC3C31

View file

@ -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 } }))
} }