Skip to content

fix(ethstats): WSS Handling#21595

Merged
mattsse merged 4 commits intoparadigmxyz:mainfrom
MysticRyuujin:fix/ethstats
Jan 30, 2026
Merged

fix(ethstats): WSS Handling#21595
mattsse merged 4 commits intoparadigmxyz:mainfrom
MysticRyuujin:fix/ethstats

Conversation

@MysticRyuujin
Copy link
Copy Markdown
Contributor

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:

2026-01-29T19:46:04.870116Z ERROR shutting down due to error
Error: WebSocket error: HTTP error: 301 Moved Permanently

Caused by:
    HTTP error: 301 Moved Permanently

Location:
    /home/runner/work/reth/reth/crates/node/builder/src/launch/common.rs:1131:24

This change allows you to add wss:// to the host portion to explicitly use WSS

@github-project-automation github-project-automation Bot moved this to Backlog in Reth Tracker Jan 29, 2026
@MysticRyuujin MysticRyuujin changed the title fix/ethstats: WSS Handling fix(ethstats): WSS Handling Jan 29, 2026
Copy link
Copy Markdown
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, ty

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();
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could maybe do the host check here, but doesnt really matter

@github-project-automation github-project-automation Bot moved this from Backlog to In Progress in Reth Tracker Jan 30, 2026
@mattsse mattsse added the C-bug An unexpected or incorrect behavior label Jan 30, 2026
@mattsse mattsse added this pull request to the merge queue Jan 30, 2026
Merged via the queue into paradigmxyz:main with commit d4fa680 Jan 30, 2026
47 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Reth Tracker Jan 30, 2026
@MysticRyuujin
Copy link
Copy Markdown
Contributor Author

MysticRyuujin commented Feb 16, 2026

Hey @mattsse not sure what happened here but the docker image of the latest version (v1.11.0) is crashing with:

2026-02-16T21:54:12.073999Z 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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug An unexpected or incorrect behavior

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants