fix to allow running the backend on port 443 without https (wss protocol is required even without an SSL certificate)

This commit is contained in:
Dave Morris 2023-08-09 20:08:36 -05:00
commit 97bf39143d

View file

@ -160,7 +160,7 @@ export default function FormModal({
}
function getWebSocketUrl(chatId, isDevelopment = false) {
const isSecureProtocol = window.location.protocol === "https:";
const isSecureProtocol = window.location.protocol === "https:" || window.location.port === "443";
const webSocketProtocol = isSecureProtocol ? "wss" : "ws";
const host = isDevelopment ? "localhost:7860" : window.location.host;
const chatEndpoint = `/api/v1/chat/${chatId}`;