feat: Forward service traffic to hero_router instead of direct socket access #19
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_proxy#19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
hero_proxy currently does its own socket discovery and forwards requests directly to Unix sockets. This bypasses hero_router, which is supposed to be the single component that talks to sockets (prefix stripping, header injection, service discovery).
Current flow
hero_router is not involved. If hero_router is stopped, hero_proxy still works.
Required flow
hero_proxy handles: network (Mycelium/TLS), auth, domain routing.
hero_router handles: socket discovery, prefix stripping, header injection.
Implementation
Replace the path-based socket routing in
proxy_handlerwith a singleforward_to_upstream("http://127.0.0.1:9988", ...)call. Theforward_to_upstreamfunction already exists indomain.rsfor domain-based TCP routing.Changes in
proxy.rsReplace the socket lookup block (find_socket_by_name, find_socket_for, extract_two_segment_prefix, not_found_page) with:
The original URL path is preserved unchanged. hero_router handles prefix stripping and socket routing.
Changes in
config.rsAdd
router_urlto config:Configurable via
HERO_ROUTER_URLenv var.What stays
What gets removed from proxy_handler
Related