WebSDR Support Forum

General Category => PhantomSDR Bugs => Topic started by: Emmanuel SV1BTL on Oct 18, 2026, 10:54 AM

Title: Receive Diversity not working with https:// instances
Post by: Emmanuel SV1BTL on Oct 18, 2026, 10:54 AM
==============================================================================
PhantomSDR-Plus — Receive diversity and https://
SV1BTL — https://github.com/sv1btl/PhantomSDR-Plus
17 October 2026
==============================================================================

WHY THIS NOTE

If your receiver is served over https:// (Caddy, set up with setup-https.sh), receive diversity has so far failed with most partners: other PhantomSDR+ stations and KiwiSDRs stayed on "connecting" for ever, while the very same partners worked from your http:// address.

The reason is a browser rule, not a fault in your station. A page opened over https:// may only open secure wss:// connections; the browser blocks plain ws:// connections before they even leave the listener's computer. Most PhantomSDR+ stations and every KiwiSDR offer only ws://, so an https page could never reach them. An http:// page has no such restriction: it may open both ws:// and wss://.

The fix: an https page now reaches those partners through your own WebSDR relay. The browser connects securely to your station (wss://your.name/relay/...), and the relay connects onward to the partner over ws://. The relay accepts only the diversity audio paths (PhantomSDR+ /audio, KiwiSDR /kiwi/.../SND), only public addresses (never your LAN or the computer itself), and keeps its usual limits per partner and in total.

The same update also fixes diversity to stations that require the current client version (they answer "out of date"): those stayed on "connecting" too, on http and https alike.


------------------------------------------------------------------------------
A. YOUR STATION ALREADY SERVES https://
------------------------------------------------------------------------------

1. Update the station:
 
cd ~/PhantomSDR-Plus
  bash update.sh

Answer y to "Update these files now?". It saves what it replaces and rebuilds the web page by itself. (By hand instead: unpack update.zip over your tree, then ./recompile.sh --frontend.)

2. Make sure the relay runs. Check:
 
systemctl is-active phantomsdr-websdr-relay
If it says "active", go to step 3. Otherwise install it:
 
bash setup_websdr_relay.sh
On a station set up with configure-station.sh (every https station is), it sees that it sits behind the proxy: it listens on this computer only and is reached as /relay through your existing address, so no router port has to be opened and nothing has to be rebuilt. Give your callsign and site address when asked (they are sent to the partners, so their operators know who connects), and choose [1] to install it as a systemd service.

Or run bash configure-station.sh and answer yes to the relay question (it defaults to yes on an https station): the wizard now installs and starts the relay by itself.

3. Restart the proxy, the relay and the admin panel (the receivers keep running; the proxy restart briefly disconnects listeners, who reload the page):
 
sudo systemctl restart phantomsdr-proxy
  sudo systemctl restart phantomsdr-websdr-relay
  sudo systemctl restart phantomsdr-admin

4. Check it. Open https://your.name/relay/status in a browser: it should show a few lines starting with "service": "PhantomSDR-Plus WebSDR relay". Then open your https:// page, expand Receive Diversity, choose a plain-http PhantomSDR+ partner and Start: it should reach "ready" within a few seconds.

Good to know:

- Through the relay, the partner sees YOUR server's address, not the listener's. A partner with a per-IP limit (PhantomSDR+ allows 3 by default) therefore counts all your relayed listeners together.
- Each relayed listener costs your upload about 30–50 kbit/s, the same as one ordinary listener.
- Partners that are https themselves (UberSDR, https PhantomSDR+ stations) are reached directly and never use the relay.
- Your http:// address keeps working exactly as before, without the relay.


------------------------------------------------------------------------------
B. YOUR STATION IS http:// ONLY
------------------------------------------------------------------------------

Nothing is required. An http page reaches ws:// and wss:// partners directly, so the relay is not involved and the https change does not affect you.

The update is still recommended, for the "out of date" fix:
 
cd ~/PhantomSDR-Plus
  bash update.sh
  sudo systemctl restart phantomsdr-proxy
  sudo systemctl restart phantomsdr-admin

The relay stays optional for you: it is needed only if you want WebSDR (websdr.org) partners. If you run it, restart it too (sudo systemctl restart phantomsdr-websdr-relay).


------------------------------------------------------------------------------
C. MOVING FROM http:// TO https:// LATER
------------------------------------------------------------------------------

You need:

- a station set up with configure-station.sh (an older station: run bash configure-station.sh once — it keeps your ports and settings),
- a DNS name pointing at your public address (a free dynamic-DNS name is fine; https certificates are not issued for a bare IP address),
- your router forwarding TCP 443 and TCP 80 to this computer (80 is used only to prove the name is yours when the certificate is issued or renewed).

Then:

1. Update first (section B), so the page knows how to use the relay.

2. Run the wizard and answer yes to "Also serve the receiver over https://?":

bash configure-station.sh
It sets up Caddy and the free Let's Encrypt certificate (setup-https.sh) by itself. The relay question that follows now defaults to yes when https is on — keep it yes, and the wizard installs and starts the relay too. (bash setup-https.sh on its own does only the https part; then install the relay with bash setup_websdr_relay.sh.)

3. Check it as in section A, step 4.

Your http:// address keeps working alongside https:// — websdr.org's check, KiwiSDR clients and other stations' http pages rely on it, so leave it open.

If you ever turn https off again (bash setup-https.sh --remove), the relay may stay: it does no harm, and WebSDR partners still need it.

P.S.
A demo .json file that I use now is this: You can use it, edit it, save it, or create a new.
How to use 'Receive Diversity" manual is here:
Title: Re: Receive Diversity not working with https:// instances
Post by: Emmanuel SV1BTL on Oct 18, 2026, 12:54 PM
Another problem with Receive Diversity.
Fixed UberSDR partners whose address was copied from the browser. UberSDR's new web interface lives under /v2/ (its main address redirects there, e.g. https://wessex.zapto.org/v2/), but its audio connection is only at the root of the site, so an address with /v2/ never connected — on http and https alike.
Any path in an UberSDR address is now ignored: paste the address from the browser's bar as it is. Addresses already saved in your listeners' lists work too, without editing them.

Please either download the files and put them in PhantomSDR-Plus/frontend/src, or run the update