mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-05 21:20:40 +02:00
gets and uses forwarded prefix in socket.ts
This commit is contained in:
parent
52a798e4c8
commit
056c02c5a5
@ -6,10 +6,20 @@ export const hostname =
|
||||
process.env.NODE_ENV === "development" ? `localhost` : window.location.hostname;
|
||||
export const port =
|
||||
process.env.NODE_ENV === "development" ? 8001 : window.location.port;
|
||||
// Get the forwarded prefix from the global variable
|
||||
export const forwardedPrefix: string =
|
||||
(window as any) /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
||||
.__FORWARDED_PREFIX__ || "";
|
||||
|
||||
export const authority = `${hostname}:${port}${forwardedPrefix}`;
|
||||
|
||||
const URL = `ws://${hostname}:${port}/`;
|
||||
console.debug("Websocket: ", URL);
|
||||
|
||||
export const socket = io(URL, { path: "/ws/socket.io", transports: ["websocket"] });
|
||||
export const socket = io(URL, {
|
||||
path: `${forwardedPrefix}/ws/socket.io`,
|
||||
transports: ["websocket"],
|
||||
});
|
||||
|
||||
export const updateValue = (
|
||||
serializedObject: SerializedObject,
|
||||
|
Loading…
x
Reference in New Issue
Block a user