Skip to content

fix: make the non-WebSocket HTTP redirect target configurable - #4

Merged
Elektr0Vodka merged 1 commit into
mainfrom
fix/configurable-http-redirect
Sep 21, 2026
Merged

Elektr0Vodka merged 1 commit into
mainfrom
fix/configurable-http-redirect

Conversation

@Elektr0Vodka

Copy link
Copy Markdown

What

The broker only speaks MQTT-over-WebSocket. When a plain browser request (no WebSocket upgrade) hits the endpoint, it was 301-redirected to a hardcoded analyzer.letsmesh.net.

Make the redirect target configurable via HTTP_REDIRECT_URL (defaults to https://observers.dutchmeshcore.nl/), and use a 302 instead of a 301 so the redirect is not cached permanently by browsers.

Why

The hardcoded host is not the right front-end for this deployment, and a permanent 301 is sticky in browser caches. Config-driven is one line to change per deployment.

Changes

  • src/server.ts — HTTP_REDIRECT_URL env (default observers.dutchmeshcore.nl), 301 to 302.
  • .env.example — document HTTP_REDIRECT_URL.

No behavioural change to MQTT auth, topics, or forwarding. tsc --noEmit clean.

The broker only speaks MQTT-over-WS; a plain browser request is redirected to the front-end. Replace the hardcoded analyzer.letsmesh.net 301 with a configurable HTTP_REDIRECT_URL (302), defaulting to https://observers.dutchmeshcore.nl/.
@Elektr0Vodka
Elektr0Vodka merged commit a64d5c9 into main Sep 21, 2026
1 check passed
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