Skip to content

Fix WebSocket scheme detection for HTTPS deployments - #15

Open
lkirc wants to merge 1 commit into
3dmedium:masterfrom
lkirc:fix-ws-scheme-https
Open

Fix WebSocket scheme detection for HTTPS deployments#15
lkirc wants to merge 1 commit into
3dmedium:masterfrom
lkirc:fix-ws-scheme-https

Conversation

@lkirc

@lkirc lkirc commented Jun 23, 2026

Copy link
Copy Markdown

Summary

Fix WebSocket URL generation in ServerConnectorService.ts so the UI works when served over HTTPS behind a TLS-terminating proxy.

Root cause

window.location.protocol returns http: or https: with a trailing colon, but the existing code compared it to http / https without the
colon. That made the condition always false, so the client always built a ws:// URL.

When the page is loaded over HTTPS, the browser blocks that as mixed content and the UI stays stuck on “connecting...”.

Fix

Build the WebSocket scheme from window.location.protocol === 'https:' and use window.location.host so hostname and port are handled consistently.

Behavior

  • HTTPS page -> wss://...
  • HTTP page -> ws://...

Verification

  • HTTPS deployment now opens the WebSocket successfully.
  • HTTP deployment still works unchanged.

znerol2 added a commit to dmfdeploy/dmf-media that referenced this pull request Jun 23, 2026
The build-stage mixed-content sed-patch is superseded by upstream fix
3dmedium/nmos_crosspoint#15. Document that the patch RUN block must be
deleted (and NMOS_CROSSPOINT_REF bumped) once a ref including #15 is
pinned — the fail-closed grep guards will break the build by design
until then. Tracked in dmfdeploy/dmfdeploy#129.

Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
github-actions Bot pushed a commit to dmfdeploy/dmf-media that referenced this pull request Jun 23, 2026
The build-stage mixed-content sed-patch is superseded by upstream fix
3dmedium/nmos_crosspoint#15. Document that the patch RUN block must be
deleted (and NMOS_CROSSPOINT_REF bumped) once a ref including #15 is
pinned — the fail-closed grep guards will break the build by design
until then. Tracked in dmfdeploy/dmfdeploy#129.

Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
@3dmedium

3dmedium commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Thanks for reporting, i will try to include this in the next commit.
Just be carfeul, my commits at the moment are not seen as stable. Just wait for the nex release to use this fix in dmf-media.
Can you please Update your code to support custom ports?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants