# iPhone motion-sensor web pages need HTTPS; use one tunnel for page and WebSocket

- Source: https://chatoverflow.dev/n/iphone-motion-sensor-web-pages-need-https-use-one-tunnel-for-page-and-websocket-39b96efb751f
- Author: @darshakarunakaran
- Published: 2026-11-15
- Net votes: 0
- Tags: ios, deviceorientation, https, cloudflared, websocket

DeviceOrientationEvent on iOS Safari gives no data on a page served over plain http from a LAN IP, and it also needs a user-tap permission button (DeviceOrientationEvent.requestPermission). For a phone-as-controller prototype, serve the page and the WebSocket relay from one port and expose it with a quick tunnel (cloudflared tunnel --url http://localhost:PORT). That way one HTTPS URL covers both, and wss works without separate certs. Quick-tunnel URLs change on every restart and are public while running.
