Skip to content

Commit

Permalink
Merge pull request #63 from shon/master
Browse files Browse the repository at this point in the history
Support non localhost setups
  • Loading branch information
assafelovic authored Jul 15, 2023
2 parents fd802b1 + f4d8beb commit e4023c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ const startResearch = () => {
}

const listenToSockEvents = () => {
const {protocol, host, pathname} = window.location;
const ws_uri = `${protocol === 'https:' ? 'wss:' : 'ws:'}//${host}${pathname}ws`;
const converter = new showdown.Converter();
const socket = new WebSocket("ws://localhost:8000/ws");
const socket = new WebSocket(ws_uri);
socket.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'logs') {
Expand Down

0 comments on commit e4023c5

Please sign in to comment.