fix(events): use ws:// when API host is http:// (dev mode support)#201
Merged
hsablonniere merged 1 commit intoCleverCloud:masterfrom Apr 1, 2026
Merged
Conversation
EventsStream always forced wss: protocol for WebSocket connections, breaking local development environments without TLS. Fix: use ws: when API host protocol is http:, wss: otherwise. Backward-compatible — production https:// continues to use wss:. Context: discovered during Clever Cloud Rust monolith migration. Dev-runner serves on HTTP, Console3 EventsStream failed silently trying wss://localhost:8080 with no TLS certificate.
hsablonniere
approved these changes
Apr 1, 2026
Member
hsablonniere
left a comment
There was a problem hiding this comment.
My first reaction was "you should be able to have secured WS, even locally" but I guess this is OK to merge it if it helps.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
EventsStream always forces
wss:protocol for the WebSocket connection, even when the API host useshttp://. This breaks local development environments where TLS is not configured.Fix
Use
ws:when the API host protocol ishttp:,wss:otherwise. This is backward-compatible — production environments usinghttps://will continue to usewss:as before.Context
Discovered during the Clever Cloud Rust monolith migration (
clevercloud-rust-rebuilt). The dev-runner serves the full API on HTTP without TLS, and Console3's EventsStream fails silently because it trieswss://localhost:8080which has no TLS certificate.