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:
+14
-1
@@ -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>
|
||||||
|
|
||||||
@@ -779,6 +779,19 @@ function escHtml(s) {
|
|||||||
// --- Init ---
|
// --- Init ---
|
||||||
loadGuide();
|
loadGuide();
|
||||||
loadSaved();
|
loadSaved();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user