mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-12-23 14:31:20 +01:00
adds support for X-Forwarded-Proto
This commit is contained in:
@@ -10,10 +10,16 @@ const port = process.env.NODE_ENV === "development" ? 8001 : window.location.por
|
||||
export const forwardedPrefix: string =
|
||||
(window as any) /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
||||
.__FORWARDED_PREFIX__ || "";
|
||||
// Get the forwarded protocol type from the global variable
|
||||
export const forwardedProto: string =
|
||||
(window as any) /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
||||
.__FORWARDED_PROTO__ || "http";
|
||||
|
||||
export const authority = `${hostname}:${port}${forwardedPrefix}`;
|
||||
|
||||
const URL = `ws://${hostname}:${port}/`;
|
||||
const wsProto = forwardedProto === "http" ? "ws" : "wss";
|
||||
|
||||
const URL = `${wsProto}://${hostname}:${port}/`;
|
||||
console.debug("Websocket: ", URL);
|
||||
export const socket = io(URL, {
|
||||
path: `${forwardedPrefix}/ws/socket.io`,
|
||||
|
||||
Reference in New Issue
Block a user