Skip to content

Commit

Permalink
svelte: hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
tbmc committed May 29, 2024
1 parent 385df4b commit 6f9f009
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion svelte/src/lib/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const connectWebsocket = (

const protocol = window.location.protocol;
const websocketProtocol = protocol.includes('https') ? 'wss' : 'ws';
const host = window.location.host;
const hostname = window.location.hostname;
const port = window.location.port;
socket = new WebSocket(`${websocketProtocol}://${hostname}:${port}/`);
console.log(`${websocketProtocol}://${hostname}:${port}/`, socket);
Expand Down

0 comments on commit 6f9f009

Please sign in to comment.