Skip to content

Commit

Permalink
wss: custom websocket url
Browse files Browse the repository at this point in the history
  • Loading branch information
tbmc committed May 29, 2024
1 parent 9702779 commit a393b4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion svelte/src/lib/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export const connectWebsocket = (
const websocketProtocol = protocol.includes('https') ? 'wss' : 'ws';
const host = window.location.host;

Check failure on line 42 in svelte/src/lib/websocket.ts

View workflow job for this annotation

GitHub Actions / Build and lint Svelte

'host' is assigned a value but never used
const port = window.location.port;
socket = new WebSocket(`${websocketProtocol}://${host}:${port}/`);
socket = new WebSocket(`${websocketProtocol}://${hostname}:${port}/`);
console.log(`${websocketProtocol}://${hostname}:${port}/`, socket);
socket.addEventListener('open', onOpen);
socket.addEventListener('message', onMessage);

Expand Down

0 comments on commit a393b4f

Please sign in to comment.