Skip to content

Commit

Permalink
fix websocket path
Browse files Browse the repository at this point in the history
  • Loading branch information
pail23 committed Jun 20, 2023
1 parent 48af227 commit 2b2e72e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/devices.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export default class DevicesAPIService {
if (this.socket) throw "already initialized";
if (baseUrl.endsWith("/")) baseUrl = baseUrl.slice(0, -1);
this.baseUrl = baseUrl;
const pathname = new URL(baseUrl).pathname;

const sio_path = pathname + "ws/socket.io/"
let pathname = new URL(baseUrl).pathname;
if (pathname.endsWith("/")) pathname = pathname.slice(0, -1);
const sio_path = pathname + "/ws/socket.io/"
// const wsUrl = baseUrl.replace("http", "ws");
console.log(`Connecting to Energy Assistant WS API path ${sio_path}`);

Expand Down

0 comments on commit 2b2e72e

Please sign in to comment.