fix(ethstats): WSS Handling#21595
Merged
mattsse merged 4 commits intoparadigmxyz:mainfrom Jan 30, 2026
Merged
Conversation
mattsse
approved these changes
Jan 30, 2026
Comment on lines
+52
to
+60
| // Detect and strip protocol prefix if present | ||
| let mut use_tls = false; | ||
| if let Some(stripped) = host.strip_prefix("wss://") { | ||
| use_tls = true; | ||
| host = stripped.to_string(); | ||
| } else if let Some(stripped) = host.strip_prefix("ws://") { | ||
| use_tls = false; | ||
| host = stripped.to_string(); | ||
| } |
Collaborator
There was a problem hiding this comment.
oh I see, this would previously only support hosts like @ethstats-server:3000
checking prefix here makes sense
Comment on lines
+112
to
+113
| let protocol = if self.credentials.use_tls { "wss" } else { "ws" }; | ||
| let full_url = format!("{}://{}/api", protocol, self.credentials.host); |
Collaborator
There was a problem hiding this comment.
we could maybe do the host check here, but doesnt really matter
Amp-Thread-ID: https://ampcode.com/threads/T-019c0eb3-d6d0-73b5-8da8-3752462ee882 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019c0f4d-657e-70a7-9a24-cd8956850efe Co-authored-by: Amp <amp@ampcode.com>
Contributor
Author
|
Hey @mattsse not sure what happened here but the docker image of the latest version ( Something in the build needs fixing? |
MysticRyuujin
added a commit
to MysticRyuujin/reth
that referenced
this pull request
Mar 18, 2026
Basically at the same time that paradigmxyz#21595 was merged, paradigmxyz#21584 was also merged and it broke TLS support for ethstats Trying to use ethstats with `wss://` right now results in: ```text ERROR shutting down due to error Error: WebSocket error: URL error: TLS support not compiled in Caused by: 0: URL error: TLS support not compiled in 1: TLS support not compiled in Location: /app/crates/node/builder/src/launch/common.rs:1101:24 ``` This fixes that
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.
The current ethstats flag hard codes ws:// but if you need to use wss:// you can't and if you try to use a 301 redirect reth will panic and crash:
This change allows you to add wss:// to the host portion to explicitly use WSS