Skip to content

Commit

Permalink
Add support for wss
Browse files Browse the repository at this point in the history
  • Loading branch information
ajami1331 committed Dec 7, 2023
1 parent 3e7649c commit 5b49bf0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sojj/Services/JudgeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public JudgeService(ILogger<JudgeService> logger, IConfiguration configuration)

httpClient = new HttpClient(pollyHandler);
httpClient.BaseAddress = baseUrl;
wsUrl = new Uri("ws://" + httpClient.BaseAddress.Host + ":" + httpClient.BaseAddress.Port + "/judge/consume-conn/websocket");
var wsScheme = httpClient.BaseAddress.Scheme.Equals("https", StringComparison.OrdinalIgnoreCase) ? "wss://" : "ws://";
wsUrl = new Uri(wsScheme + httpClient.BaseAddress.Host + ":" + httpClient.BaseAddress.Port + "/judge/consume-conn/websocket");
ws = new ClientWebSocket();
ws.Options.Cookies = socketHandler.CookieContainer;
}
Expand Down

0 comments on commit 5b49bf0

Please sign in to comment.