HydraIssues

Per-district hydraneckwebrtc routing
open feature Project: hydraheadwebstream Reporter: 24 Mar 2026 07:32

Description

Problem

hydraheadwebstream and hydracluster currently hardcode a single global neckwebrtc controller URL. With the Brussels district now deployed at hydraneckwebrtc-brussels.experiencenet.com, sessions have no way to route to the correct regional controller.

The district field is already passed in session requests but is purely informational — it does not affect which controller handles the session.

Proposed Solution

Add a district-to-controller mapping in both services:

hydraheadwebstream

  • Add NeckWebRTCResolver with ForDistrict(district) method
  • Config gains districts map under hydraneckwebrtc section
  • handleWebSocket resolves the correct client before creating a session
  • Files: internal/cli/serve.go, internal/client/neckwebrtc.go, internal/api/server.go, internal/api/handlers.go

hydracluster

  • buildNeckWebRTCWorkerConfig uses node.District to pick the correct controller URL
  • Config gains districts map under hydraneckwebrtc section
  • Files: internal/cli/cluster/serve.go, pkg/api/server.go, pkg/api/handlers_body.go

Config Example

# hydraheadwebstream
hydraneckwebrtc:
  default_url: "https://hydraneckwebrtc.experiencenet.com"
  token: "..."
  districts:
    brussels:
      url: "https://hydraneckwebrtc-brussels.experiencenet.com"

# hydracluster
hydraneckwebrtc:
  controller_url: "https://hydraneckwebrtc.experiencenet.com"
  controller_token: "..."
  admin_token: "..."
  districts:
    brussels:
      controller_url: "https://hydraneckwebrtc-brussels.experiencenet.com"

Backwards compatible — existing configs without districts continue to work unchanged.

Comments (1)

nebula 24 Mar 2026 07:34

Grooming: set priority to high

Nebula's reasoning: This feature is blocking proper multi-district operation. The Brussels district is already deployed but sessions cannot route to it — all traffic still hits the global controller. High priority because it directly impacts a live regional deployment and the district field is already being passed but ignored, meaning the infrastructure expectation is already there. Title, description, category, and project are all well-defined — no changes needed.

(migrated from issues.nimsforest.nimsforest.com #71)