diff --git a/DEVELOPER_SETUP.md b/DEVELOPER_SETUP.md index aa2742640..0ae3b7c9e 100644 --- a/DEVELOPER_SETUP.md +++ b/DEVELOPER_SETUP.md @@ -185,7 +185,7 @@ For responsive layouts, use the viewport toolbar presets from `.storybook/rommVi #### - Optional: local frontend against a remote RomM -To run `npm run dev` or `npm run preview` against another RomM instance (for example a home server with a full library), set `DEV_PROXY_TARGET` in the repo-root `.env` to its origin, such as `https://romm.example.com`. Vite then proxies `/api`, `/ws` and `/assets/romm` there instead of the local backend. Leave it empty to keep the default `http://127.0.0.1:${DEV_PORT}`. +To run `npm run dev` or `npm run preview` against another RomM instance (for example a home server with a full library), set `DEV_PROXY_TARGET` in the repo-root `.env` to its origin, such as `https://romm.example.com`. Vite then proxies `/api`, `/ws` and `/assets/romm` there instead of the local backend. Leave it empty to keep the default `http://127.0.0.1:${DEV_PORT}`. The remote's TLS certificate must be valid. Sign in with a username and password: OIDC login does not work through the proxy, because the identity provider redirects to the remote's `OIDC_REDIRECT_URI`, so the session never reaches localhost. ## Setting up the linter diff --git a/frontend/vite.config.js b/frontend/vite.config.js index aeef03c21..46ba95c2f 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -72,7 +72,11 @@ export default defineConfig(({ mode }) => { const proxyTarget = env.DEV_PROXY_TARGET || `http://127.0.0.1:${backendPort}`; const remote = Boolean(env.DEV_PROXY_TARGET); - const upstream = { target: proxyTarget, changeOrigin: remote, secure: false }; + const upstream = { + target: proxyTarget, + changeOrigin: remote, + secure: remote, + }; const proxy = { "/api": upstream, "^/(?:ws|netplay)": { ...upstream, ws: true },