sphinx-autobuild icon indicating copy to clipboard operation
sphinx-autobuild copied to clipboard

Allow ovverriding websocket host, port, and schema

Open KyeRussell opened this issue 1 month ago • 0 comments

Fixes #185

My Docker Compose-based development environment involves sphinx-autobuild sitting behind a reverse proxy. The reverse proxy serves sphinx-autobuild as HTTPS. This breaks a couple of assumptions made by sphinx-autobuild, particularly the largely hard-coded websocket setup HTML/JS snippet that it injects into the HTML response sent to the browser.

This PR allows using the --ws-port and --ws-host command line options to override the host and port used during client-side websocket setup. Therefore allowing the values to be customised to accommodate reverse proxy setups.

Also, the ws schema actually implies an insecure (non-HTTPS) connection. websocket-over-HTTPS connections use wss. --ws-https tells sphinx-autobuild that, from the browser's perspective, it's being accessed in a HTTPS context, and for it to adjust its output appropriately (including using wss instead of ws.

KyeRussell avatar Nov 03 '25 04:11 KyeRussell