Troubleshooting WebSocket & VTX
Stuck getting WebSocket or the VTX client working? See the common problems below. You can also reach out by creating an Issue or starting a Discussion.
Black Screen / No VTX Client Visible
Section titled “Black Screen / No VTX Client Visible”Symptom:
Navigating to vtx.html shows only a black page. The browser console contains an error similar to:
Uncaught TypeError: n is not a function vtxclient.js:4715or
Cannot read properties of undefinedCause:
A value in vtxdata.js is the wrong type for the version of VTX_ClientServer you downloaded. The most common culprit is defCrsrAttr.
Solution:
Ensure defCrsrAttr is an array, not a hex integer:
// Wrong — causes the black screen crash:defCrsrAttr: 0x0207,
// Correct:defCrsrAttr: ['thick', 'horizontal'],Cross-check your entire vtxdata.js against the working example in the WebSocket setup guide.
Browser Refuses WebSocket Connection (Mixed Content)
Section titled “Browser Refuses WebSocket Connection (Mixed Content)”Symptom: The VTX page loads but immediately fails to connect. The browser console shows:
Mixed Content: The page at 'https://...' was loaded over HTTPS, but attemptedto connect to the insecure WebSocket endpoint 'ws://...'. This request hasbeen blocked.Cause:
Browsers block plain ws:// connections from pages served over HTTPS. This is a browser security policy and cannot be worked around from ENiGMA’s side.
Solution:
Use a secure wss:// WebSocket endpoint. See Deployment Architectures for the two supported options (reverse proxy or direct TLS in ENiGMA).
If you are testing locally over plain HTTP, ws:// is fine. For any public deployment where the VTX page is served over HTTPS, wss:// is required.
Connection Refused on WebSocket Port
Section titled “Connection Refused on WebSocket Port”Symptom: The browser console shows:
WebSocket connection to 'wss://your-hostname:8811' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSEDSolutions to check in order:
-
ENiGMA was not restarted after adding the
webSocketblock toconfig.hjson. Restart and check the logs for a line like:INFO: Listening for connections (server="WebSocket (secure)", port=8811)If that line is absent, the server did not start — look for an error above it in the log.
-
Port not forwarded. If ENiGMA is behind a router, port
8811(or whichever port you configured) must be forwarded to the host running ENiGMA. See Network Setup. -
Firewall blocking the port. Check your host firewall (
ufw,iptables, security groups, etc.) for the configured port. -
Wrong port in
vtxdata.js. ThewsConnectvalue must match the port ENiGMA is actually listening on.
Certificate / TLS Errors
Section titled “Certificate / TLS Errors”Symptom: The browser shows a certificate warning or the console shows:
WebSocket connection failed: ERR_CERT_AUTHORITY_INVALIDor ENiGMA logs show an error starting the wss:// listener.
Solutions:
-
Self-signed certificate. Browsers reject self-signed certs for WebSocket connections just as they do for HTTPS. Use a certificate from a trusted CA — Let’s Encrypt is free and widely trusted. Alternatively, use Option A (reverse proxy) so nginx/Caddy owns the certificate.
-
Certificate not readable by ENiGMA. Let’s Encrypt writes certificates to
/etc/letsencrypt/which is only readable by root. If ENiGMA does not run as root (it should not), copy the cert and key to a location the ENiGMA user can read, and update that copy when the cert renews (e.g. acertbotdeploy hook). -
Wrong paths in config. Double-check
certPemandkeyPemin thewssblock point to the correct files. ENiGMA will fail to start thewss://listener if either path is wrong.
proxied: true Not Working / Treated as Insecure
Section titled “proxied: true Not Working / Treated as Insecure”Symptom:
With proxied: true set and nginx forwarding connections, features that require a secure connection (such as 2FA/OTP registration) report that the connection is insecure.
Solutions:
-
Missing
X-Forwarded-Protoheader. ENiGMA treats a proxied connection as secure only when it carriesX-Forwarded-Proto: https. Confirm your nginx config includes:proxy_set_header X-Forwarded-Proto https; -
Proxy not in
trustedProxies. Forwarded headers are ignored unless the proxy’s address is intrustedProxies, which by default covers loopback and the private ranges only. If the log showsIgnoring forwarded headers from a WebSocket peer not in trustedProxies, add that address. See Trusted Proxies. -
proxied: trueset but no proxy in use. If ENiGMA is exposed directly to the internet (not behind nginx/Caddy), do not setproxied: true. Use thewss:block directly instead.
Every Caller Shows the Proxy’s Address
Section titled “Every Caller Shows the Proxy’s Address”Symptom:
Behind a reverse proxy, every WebSocket caller is logged from the proxy’s address (often 127.0.0.1), and the log shows WebSocket connection from a trusted proxy carried no client address.
Solution:
Have the proxy send the caller’s address, and set proxied: true. For nginx:
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Real-IP $remote_addr;If the proxy is not on the same host, in a container or on the LAN, also add its address to trustedProxies. See Trusted Proxies.
VTX Page Shows Splash but Immediately Disconnects
Section titled “VTX Page Shows Splash but Immediately Disconnects”Symptom: The VTX splash graphic appears briefly then the client disconnects or shows a connection error overlay.
Solutions to check:
-
wsConnectpoints to wrong address or port. Verify the value invtxdata.jsmatches what ENiGMA is actually listening on and what is reachable from the browser. -
wsProtocolmismatch. ENiGMA expectstelnetsub-protocol negotiation. Ensurevtxdata.jshas:wsProtocol: 'telnet',wsDataType: 'arraybuffer', -
ENiGMA log errors. Check ENiGMA’s log at the time of the connection attempt for any errors during the WebSocket handshake or login sequence.