strm-router is a lightweight HTTP router that forwards incoming requests to different backend services based on the Authorization header. It is designed for simple service routing in cloud-based environments.
- Routes requests based on
Authorizationheader values - Simple JSON-based configuration
- Minimal dependency setup
- Fast Go-based HTTP proxying
Create a config.json file in the project root:
{
"serviceA": "http://localhost:8081",
"serviceB": "http://localhost:8082"
}Make sure you have Go installed (1.18+ recommended).
go build main.goThis will produce an executable binary.
./mainBy default, the server starts on the configured port (check source code if you need to change it).
- Client sends HTTP request with
Authorizationheader strm-routerreads the header value- It matches the value against
config.json - Request is proxied to the mapped service URL
- Response is returned to the client
aws s3 lsstrm bkt ls