-
- {peerConnection?.connectionState == "connected" && (
-
-
-
-
-
{
- videoElm.current?.play();
- }}
- />
+
+ {/* In relative mouse mode and under https, we enable the pointer lock, and to do so we need a bar to show the user to click on the video to enable mouse control */}
+
+
+ {peerConnection?.connectionState == "connected" && (
+
+
+
+
+ {
+ videoElm.current?.play();
+ }}
+ />
+
-
- )}
+ )}
+
diff --git a/ui/vite.config.ts b/ui/vite.config.ts
index f6aae50..f8459cd 100644
--- a/ui/vite.config.ts
+++ b/ui/vite.config.ts
@@ -1,23 +1,32 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import tsconfigPaths from "vite-tsconfig-paths";
+import basicSsl from "@vitejs/plugin-basic-ssl";
declare const process: {
env: {
JETKVM_PROXY_URL: string;
+ USE_SSL: string;
};
};
export default defineConfig(({ mode, command }) => {
const isCloud = mode.indexOf("cloud") !== -1;
const onDevice = mode === "device";
- const { JETKVM_PROXY_URL } = process.env;
+ const { JETKVM_PROXY_URL, USE_SSL } = process.env;
+ const useSSL = USE_SSL === "true";
+
+ const plugins = [tsconfigPaths(), react()];
+ if (useSSL) {
+ plugins.push(basicSsl());
+ }
return {
- plugins: [tsconfigPaths(), react()],
+ plugins,
build: { outDir: isCloud ? "dist" : "../static" },
server: {
host: "0.0.0.0",
+ https: useSSL,
proxy: JETKVM_PROXY_URL
? {
"/me": JETKVM_PROXY_URL,