feat: Dynamic socket-name URL routing for multi-service support #17
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!17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_hero_compute_support"
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
/{service}/{socket_name}/*with dynamic filesystem lookup/{service}/*routing unchanged as fallbackHow it works
When a request arrives at
/{service}/{second_segment}/*, hero_proxy checks if$HERO_SOCKET_DIR/{service}/{second_segment}.sockexists on disk. If found, routes to it with the prefix stripped. Otherwise falls back to existingfind_socket_for()single-segment routing.No hardcoded socket types — any
.sockfile a service creates is automatically routable.Test plan
cargo build --workspacepassescargo clippy --workspace --all-targets -- -D warningspassescargo test --workspace— 97 passed, 0 failedCloses #16
Add two-segment URL routing: /{service}/{socket_name}/* When a request arrives at /{service}/{second_segment}/*, hero_proxy checks if $HERO_SOCKET_DIR/{service}/{second_segment}.sock exists. If found, routes to it directly with the prefix stripped. Falls back to the existing find_socket_for() single-segment routing. This enables callers to target specific sockets by name: /hero_compute/rpc/* → hero_compute/rpc.sock /hero_compute/explorer_rpc/* → hero_compute/explorer_rpc.sock /hero_compute/ui/* → hero_compute/ui.sock No hardcoded socket types — any .sock file is automatically routable. Also fixes test mock backends to use per-service directory layout (rpc.sock inside service subdirectory) matching current socket strategy. Closes #16