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.
ws_url is ultimately comprised of the 'host' and 'port' that sphinx-autobuild is running on.
I'd like to be able to override both of these values for all instances where sphinx-autobuild is sending them to the browser, for whatever reason, including this websocket setup. That way, the values can be customised to accommodate reverse proxy setups.
Also, the ws schema actually implies an insecure (non-HTTPS) connection. websocket-over-HTTPS connections use wss. I'd like to be able to forcibly tell 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.
I may get around to submitting a PR at some point. However, the described setup isn't at all unusual, so it felt worth logging here first, to help out anyone else running into the same thing, and maybe to even prompt someone to get in before I do!
My Docker Compose-based development environment involves
sphinx-autobuild
sitting behind a reverse proxy. The reverse proxy servessphinx-autobuild
as HTTPS. This breaks a couple of assumptions made bysphinx-autobuild
, particularly the largely hard-coded websocket setup HTML/JS snippet that it injects into the HTML response sent to the browser.See: https://github.com/sphinx-doc/sphinx-autobuild/blob/86e2f373802417c944fda6c2930c8c3c98c20218/sphinx_autobuild/middleware.py#L11-L18
ws_url
is ultimately comprised of the 'host' and 'port' thatsphinx-autobuild
is running on.I'd like to be able to override both of these values for all instances where
sphinx-autobuild
is sending them to the browser, for whatever reason, including this websocket setup. That way, the values can be customised to accommodate reverse proxy setups.Also, the
ws
schema actually implies an insecure (non-HTTPS) connection. websocket-over-HTTPS connections usewss
. I'd like to be able to forcibly tellsphinx-autobuild
that, from the browser's perspective, it's being accessed in a HTTPS context, and for it to adjust its output appropriately (including usingwss
instead ofws
.I may get around to submitting a PR at some point. However, the described setup isn't at all unusual, so it felt worth logging here first, to help out anyone else running into the same thing, and maybe to even prompt someone to get in before I do!