mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
Add production deployment
This commit is contained in:
@@ -17,7 +17,12 @@ import { delay } from "./utils/utils";
|
||||
* @private
|
||||
*/
|
||||
function create(): WebSocket {
|
||||
return new WebSocket(`ws://${API_FULL_BASE_URL}/chat/ws`);
|
||||
let prefix = "ws://";
|
||||
if (location.protocol.includes("https")) {
|
||||
prefix = "wss://";
|
||||
}
|
||||
|
||||
return new WebSocket(`${prefix}${API_FULL_BASE_URL}/chat/ws`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user