Skip to content

feat(hub-client): opt-in HTTPS dev server for mobile/network testing#276

Merged
gordonwoodhull merged 1 commit into
mainfrom
feature/self-signed-cert-testing
Jun 11, 2026
Merged

feat(hub-client): opt-in HTTPS dev server for mobile/network testing#276
gordonwoodhull merged 1 commit into
mainfrom
feature/self-signed-cert-testing

Conversation

@gordonwoodhull

@gordonwoodhull gordonwoodhull commented Jun 11, 2026

Copy link
Copy Markdown
Member

With this, I was able to test, in Firefox on an Android tablet over my local network:

  • creating a project
  • creating a q2-preview document
  • add some text to the document
  • edit the text in q2-preview
  • reflected back in doc

There were some automerge timing glitches but it all worked!

Summary

  • Adds @vitejs/plugin-basic-ssl as a dev dependency
  • Activates the plugin only when VITE_HTTPS=1 is set, so the default dev workflow is unchanged
  • Documents the workflow in hub-client/README.md under a new "Testing on Mobile / Other Devices" section

Motivation

When accessing the Vite dev server by IP address (e.g. from a phone on the same WiFi), the browser treats http://192.168.x.x as an insecure context and refuses to run crypto.randomUUID() and crypto.subtle — APIs the app calls at startup. The result is a blank white page with no visible error.

Serving over HTTPS fixes this. The self-signed cert triggers a one-time browser warning, which is acceptable for local dev.

Usage

```bash
VITE_HTTPS=1 npm run dev:fresh -- --host
```

Vite will print the https://192.168.x.x:5173/ network URL to open on the device. Accept the self-signed cert warning on first visit.

Test plan

  • npm run dev:fresh (no env var) still starts on HTTP — no regression
  • VITE_HTTPS=1 npm run dev:fresh -- --host serves HTTPS and is reachable from a device on the same network
  • App loads and renders correctly on mobile (verified on Firefox/Android and Safari/iOS)

Add @vitejs/plugin-basic-ssl and wire it behind VITE_HTTPS=1 so
developers can serve the dev server over HTTPS when testing on phones
or other devices on the local network. Without HTTPS the browser treats
the IP-address origin as insecure and blocks crypto APIs, producing a
blank white page.

Usage: VITE_HTTPS=1 npm run dev:fresh -- --host
@gordonwoodhull
gordonwoodhull merged commit f4d74e1 into main Jun 11, 2026
5 checks passed
@gordonwoodhull
gordonwoodhull deleted the feature/self-signed-cert-testing branch June 11, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant