fix: split noVNC to separate vnc.ampbox.io host for WebSocket support

- FastAPI httpx proxy can't handle WebSocket upgrades (status 101)
- noVNC iframe now points to vnc.ampbox.io (port 6080 via cloudflared)
- App UI stays at browser.ampbox.io (port 8080 via cloudflared)
- Auto-detects local vs ampbox.io for iframe src
This commit is contained in:
Ken
2026-05-25 23:17:51 +00:00
parent f30af4aefd
commit 7e8fa0024a
+15 -2
View File
@@ -484,7 +484,7 @@
<span>Live Browser -- browser.ampbox.io</span> <span>Live Browser -- browser.ampbox.io</span>
</div> </div>
<div class="browser-frame"> <div class="browser-frame">
<iframe src="/vnc.html?autoconnect=true&resize=scale&reconnect=true&reconnect_delay=1000" allow="clipboard-read; clipboard-write"></iframe> <iframe id="vnc-frame" src="about:blank" allow="clipboard-read; clipboard-write"></iframe>
</div> </div>
</div> </div>
@@ -780,5 +780,18 @@ function escHtml(s) {
loadGuide(); loadGuide();
loadSaved(); loadSaved();
</script> </script>
</body>
<script>
// Point noVNC iframe to vnc.ampbox.io (separate cloudflare tunnel to port 6080)
const vncFrame = document.getElementById('vnc-frame');
const host = window.location.hostname;
const proto = window.location.protocol;
// In production: vnc.ampbox.io. Locally: same host, port 6080.
if (host.endsWith('.ampbox.io')) {
vncFrame.src = proto + '//vnc.ampbox.io/vnc.html?autoconnect=true&resize=scale&reconnect=true&reconnect_delay=1000';
} else {
vncFrame.src = proto + '//' + host + ':6080/vnc.html?autoconnect=true&resize=scale&reconnect=true&reconnect_delay=1000';
}
</script>
</body>
</html> </html>