feat: Forward service traffic to hero_router instead of direct socket access #20
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_proxy!20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_router_forwarding"
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?
Summary
hero_proxy no longer does its own socket discovery. All service requests are forwarded to hero_router at localhost:9988.
Flow
Before:
Network -> hero_proxy -> Unix sockets (direct)After:
Network -> hero_proxy -> hero_router:9988 -> Unix socketsChanges
forward_to_upstream()to hero_routerextract_two_segment_prefix,not_found_page(~190 lines removed)router_urlto AppState (env:HERO_ROUTER_URL, default:http://127.0.0.1:9988)create_app_state_with_router()for testsTest plan
cargo clippy --workspace --all-targets -- -D warningspassesCloses #19
hero_proxy no longer does its own socket discovery and routing. All service requests (/{service}/*) are forwarded to hero_router at localhost:9988 (configurable via HERO_ROUTER_URL env var). hero_router handles socket discovery, prefix stripping, and header injection. hero_proxy handles network (Mycelium/TLS), auth, and domain routing. Flow: Network -> hero_proxy -> hero_router -> Unix sockets - Replace socket lookup (find_socket_for, find_socket_by_name) with forward_to_upstream() call to hero_router - Remove extract_two_segment_prefix and not_found_page (dead code) - Add router_url to AppState (default: http://127.0.0.1:9988) - Add create_app_state_with_router() for testing - Update test harness with mock hero_router (TCP server that routes to mock backend sockets) Closes #19I have tested the flow on Hero Compute, and it is working as well