julienschmidt/httprouter
A high performance HTTP request router that scales well
Build with Backblaze B2
SDKs, agent skills, IDE extensions, and reference pipelines from Backblaze Labs. All open source.
Loading star history...
Where it stands
Rank, growth pace and release cadence relative to everything GStars tracks.
The project lists 50 contributors on GitHub.
Use Cases & Benefits
- Provides a high performance HTTP request router for Go that supports variables in routes and method-based matching.
- Delivers efficient routing with zero garbage allocations and automatic path correction, ensuring fast and scalable request handling.
- Use for building scalable RESTful APIs with hierarchical routes and native support for OPTIONS and method not allowed responses.
- Use for serving multiple domains or subdomains by combining routers with custom host-based handlers.
- Use for implementing secure endpoints with middleware like Basic Authentication integrated into route handlers.
Should you depend on it?
License terms, project hygiene and risks, from GitHub metadata and GStars' snapshots.
License
BSD 3-Clause
Permissive: commercial use, modification and redistribution are allowed with attribution.
Community files
- README: present
Watch-outs
- Warning: No commits in over a year (last push Jul 2024).
General guidance from repository metadata, not legal advice. How we score
From the README
HttpRouter is a lightweight high performance HTTP request router (also called multiplexer or just mux for short) for Go.
In contrast to the default mux of Go's
net/httppackage, this router supports variables in the routing pattern and matches against the request method. It also scales better.The router is optimized for high performance and a small memory footprint. It scales well even with very long paths and a large number of routes. A compressing dynamic trie (radix tree) structure is used for efficient matching.
Only explicit matches: With other routers, like
http.ServeMux, a requested URL path could match multiple patterns. Therefore they have some awkward pattern priority rules, like longest match or first registered, first matched. By design of this router, a request can only match exactly one or no route. As a result, there are also no unintended matches, which makes it great for SEO and improves the user experience.Stop caring about trailing slashes: Choose the URL style you like, the router automatically redirects the client if a trailing slash is missing or if there is one extra. Of course it only does so, if the new path has a handler. If you don't like it, you can turn off this behavior.
Daily snapshots
Stars gained per day, and how forks and open issues moved, from GStars' daily snapshots
Forks
1.5K+0
Open issues
87+3
Compared with peers in Networking
Fastest-growing repositories GStars tracks in this cohort for the week of Nov 8, by 7-day star growth
| Repository | Stars | +7d | Health | Last release |
|---|---|---|---|---|
| MHSanaei/3x-ui | 49.6K | +448 | 52 | 137 days ago |
| GyulyVGC/sniffnet | 42.3K | +422 | 75 | 111 days ago |
| tailscale/tailscale | 38.9K | +311 | 75 | today |
| netbirdio/netbird | 30.9K | +267 | 75 | today |
| fosrl/pangolin | 23.6K | +218 | 75 | 6 days ago |
| julienschmidt/httprouter | 17.1K | — | 35 | — |
| Category median | 38.9K | +311 | 75 | — |
Discover Repositories
Search across tracked repositories by name or description