feat: auto-detect wss:// for rosbridge when page served over HTTPS (Issue #681)

- Default URL auto-selects wss://saul-t-mote.evthings.app/rosbridge when
  page is loaded via https://, falls back to ws://100.64.0.2:9090 for
  local/Tailscale access
- Clears hardcoded ws:// value from input; JS sets it from localStorage
  or the detected default on first load

Companion: nginx config on Orin adds /rosbridge WebSocket reverse proxy
  on port 8080  →  ws://127.0.0.1:9090

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
sl-jetson 2026-04-04 11:59:36 -04:00
parent c297d24a48
commit 6b113c1f3e

View File

@ -227,7 +227,7 @@ body {
<div class="logo">⚡ SAUL-TEE TRACKER</div>
<div id="conn-bar">
<div id="ros-dot" title="ROS Bridge"></div>
<input id="ws-input" type="text" value="ws://100.64.0.2:9090" placeholder="ws://host:port" />
<input id="ws-input" type="text" value="" placeholder="ws://host:port" />
<button class="hbtn" id="btn-connect">CONNECT</button>
<span id="conn-label">Not connected</span>
</div>
@ -732,7 +732,10 @@ map.on('dragstart', () => {
// ── Init ──────────────────────────────────────────────────────────────────────
(function init() {
const saved = localStorage.getItem('saul_tee_ws_url') || 'ws://100.64.0.2:9090';
const defaultUrl = location.protocol === 'https:'
? 'wss://saul-t-mote.evthings.app/rosbridge'
: 'ws://100.64.0.2:9090';
const saved = localStorage.getItem('saul_tee_ws_url') || defaultUrl;
$('ws-input').value = saved;
drawCompass(null);
connectRos(saved);