Skip to content

Commit

Permalink
support wss://
Browse files Browse the repository at this point in the history
  • Loading branch information
OlliL committed Dec 24, 2024
1 parent 0968e3a commit 4c0bfbb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/config/WebSocketSingleton.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { StoreService } from "@/stores/StoreService";
import { Client, type StompSubscription } from "@stomp/stompjs";
import { HeaderUtil } from "../service/util/HeaderUtil";
import { webServerHost } from "./WebServerConfiguration";
import { webServerHost, webServerProtocol } from "./WebServerConfiguration";

export class WebSocketSingleton {
private static instance: WebSocketSingleton;
Expand All @@ -17,7 +17,8 @@ export class WebSocketSingleton {
}

public async connectStompClient() {
const url = "ws://" + webServerHost + "/websocket";
const webSocketProtocol = webServerProtocol.replace("http", "ws");
const url = webSocketProtocol + "//" + webServerHost + "/websocket";

this.stompClient = new Client({
brokerURL: url,
Expand Down

0 comments on commit 4c0bfbb

Please sign in to comment.