|
@@ -7,6 +7,7 @@ import { DataManager, ModuleData } from "./dataManager";
|
|
|
import { initSocket } from "./socket";
|
|
|
import { TaipyWsAdapter, WsAdapter } from "./wsAdapter";
|
|
|
import { WsMessageType } from "../../src/context/wsUtils";
|
|
|
+import { getBase } from "./utils";
|
|
|
|
|
|
export type OnInitHandler = (taipyApp: TaipyApp) => void;
|
|
|
export type OnChangeHandler = (taipyApp: TaipyApp, encodedName: string, value: unknown) => void;
|
|
@@ -46,9 +47,9 @@ export class TaipyApp {
|
|
|
onInit: OnInitHandler | undefined = undefined,
|
|
|
onChange: OnChangeHandler | undefined = undefined,
|
|
|
path: string | undefined = undefined,
|
|
|
- socket: Socket | undefined = undefined
|
|
|
+ socket: Socket | undefined = undefined,
|
|
|
) {
|
|
|
- socket = socket || io("/", { autoConnect: false });
|
|
|
+ socket = socket || io("/", { autoConnect: false, path: `${getBase()}socket.io` });
|
|
|
this.onInit = onInit;
|
|
|
this.onChange = onChange;
|
|
|
this.variableData = undefined;
|
|
@@ -252,6 +253,10 @@ export class TaipyApp {
|
|
|
getWsStatus() {
|
|
|
return this._ackList;
|
|
|
}
|
|
|
+
|
|
|
+ getBaseUrl() {
|
|
|
+ return getBase();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
export const createApp = (onInit?: OnInitHandler, onChange?: OnChangeHandler, path?: string, socket?: Socket) => {
|