From 095fe2a175796f4554fb34b34af5dc5b35363913 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Wed, 13 Nov 2024 10:34:36 -0500 Subject: [PATCH] Allow access of dev server in LAN for touch device testing (#1528) --- README.md | 10 +++++++++- vite.config.mts | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b4587d39..6ef5200c6 100644 --- a/README.md +++ b/README.md @@ -425,9 +425,17 @@ hook is used to auto-format code on commit. Note: The dev server will NOT load any extension from the ComfyUI server. Only core extensions will be loaded. -- Run `npm install` to install the necessary packages - Start local ComfyUI backend at `localhost:8188` - Run `npm run dev` to start the dev server +- Run `npm run dev:electron` to start the dev server with electron API mocked + +#### Access dev server on touch devices + +After you start the dev server, you should see following logs: +![image](https://github.com/user-attachments/assets/9e04a439-452e-468c-8ba1-de9cbab6e03f) + +Make sure your desktop machine and touch device are on the same network. On your touch device, +navigate to `http://:5173` (e.g. `http://192.168.2.20:5173` here), to access the ComfyUI frontend. ### Unit Test diff --git a/vite.config.mts b/vite.config.mts index d6fc42e63..0b8fde0b9 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -94,6 +94,7 @@ const DEV_SERVER_COMFYUI_URL = process.env.DEV_SERVER_COMFYUI_URL || 'http://127 export default defineConfig({ base: '', server: { + host: '0.0.0.0', proxy: { '/internal': { target: DEV_SERVER_COMFYUI_URL,