Routers

29 projects

Routers map an incoming method and path to a handler and extract path parameters. They are the smallest step up from the standard library: most work with ordinary http.Handler values, so you can mix them with any net/http middleware. Since Go 1.22, net/http's ServeMux supports method matching and wildcards like /users/{id}, read with r.PathValue, which covers what many projects used a router for.

chi is the most active router here; it is fully net/http compatible, supports route groups and sub-routers, and ships a set of middleware. gorilla/mux supports matching on hosts, headers and regular expressions and is widely deployed, though the repository has been quiet since 2024. julienschmidt/httprouter introduced the radix-tree approach that Gin's router derives from, and has also seen little change since 2024. Most other entries, such as Bone, Goji, gocraft/web and lars, have not been updated in years, and httptreemux is archived.

For new code, try the standard ServeMux first. If you need route groups, mounted sub-routers or a middleware stack attached per route, chi adds those without leaving net/http. Pick gorilla/mux only for its matching features or an existing codebase. Router speed rarely matters next to database and network time, so favor API fit and maintenance over benchmarks.

chiby go-chi

Small, fast and expressive HTTP router built on net/context.

github.com/go-chi/chi/v5Go 1.24+ No dependencies v5.5.0updated 15d ago

23k

muxby gorilla

Powerful URL router and dispatcher for golang.

github.com/gorilla/muxGo 1.20+ No dependencies v1.8.1updated 2y ago

21.8k

httprouterby julienschmidt

High performance router. Use this and the standard http handlers to form a very high performance web framework.

github.com/julienschmidt/httprouterGo 1.7+ No dependencies v1.3.0updated 2y ago

17.1k

gocraft/webby gocraft

Mux and middleware package in Go.

v1.1updated 6y ago

1.5k

Boneby go-zoo

Lightning Fast HTTP Multiplexer.

github.com/go-zoo/boneGo 1.9+ No dependencies v1.3.0updated 7y ago

1.3k

Goji

Goji is a minimalistic and flexible HTTP request multiplexer with support for net/context.

v2.0.1updated 4y ago

974

fasthttprouterby buaazp

High performance router forked from httprouter. The first router fit for fasthttp.

v0.1.1updated 7y ago

869

httptreemuxby dimfeld

High-speed, flexible tree-based HTTP router for Go. Inspiration from httprouter.

v5.5.0archived

619

xujiajun/gorouterby xujiajun

A simple and fast HTTP router for Go.

v1.2.0updated 7y ago

524

ozzo-routingby go-ozzo

An extremely fast Go (golang) HTTP router that supports regular expression route matching. Comes with full support for building RESTful APIs.

github.com/go-ozzo/ozzo-routing/v2Go 1.13+ 3 dependenciesv2.5.0updated 6d ago

453

larsby go-playground

Is a lightweight, fast and extensible zero allocation HTTP router for Go used to create customizable frameworks.

v4.0.1updated 7y ago

384

Siestaby VividCortex

Composable framework to write middleware and handlers.

github.com/VividCortex/siestaGo 1.12+ No dependencies v1.0.0updated 2y ago

347

vestigoby husobee

Performant, stand-alone, HTTP compliant URL Router for go web applications.

v1.1.1updated 6y ago

264

gowww/routerby gowww

Lightning fast HTTP router fully compatible with the net/http.Handler interface.

github.com/gowww/routerGo 1.14+ No dependencies updated 9mo ago

185

GoRouterby vardius

GoRouter is a Server/API micro framework, HTTP request router, multiplexer, mux that provides request router with middleware supporting net/context.

github.com/vardius/gorouter/v5Go 1.26+ 1 dependencyv5.0.0updated 5d ago

153

pureby go-playground

Is a lightweight HTTP router that sticks to the std "net/http" implementation.

github.com/go-playground/pure/v5Go 1.18+ 2 dependenciesv5.3.0updated 3y ago

153

alienby gernest

Lightweight and fast http router from outer space.

updated 2y ago

134

violetearby nbari

Go HTTP router.

7.0.0archived

107

Bxogby claygod

Simple and fast HTTP router for Go. It works with routes of varying difficulty, length and nesting. And he knows how to create a URL from the received parameters.

updated 4mo ago

104

xmuxby rs

High performance muxer based on httprouter with net/context support.

updated 9y ago

100

goblinby bmf-san

A golang http router based on trie tree.

github.com/bmf-san/goblinGo 1.22+ No dependencies 6.7.0updated 13d ago

82

ngamux

Simple HTTP router for Go.

github.com/ngamux/ngamuxGo 1.24+ 1 dependencyv1.7.49updated 3d ago

71

belltby GuilhermeCaruso

A simple Go HTTP router.

github.com/GuilhermeCaruso/belltGo 1.12+ No dependencies updated 4y ago

55

FastRouterby razonyang

A fast, flexible HTTP router written in Go.

v0.1.0updated 9y ago

25

GoLobby/Routerby golobby

GoLobby Router is a lightweight yet powerful HTTP router for the Go programming language.

github.com/golobby/routerGo 1.17+ 1 dependencyv1.3.0updated 4y ago

22

nchiby muir

Chi-like router built on httprouter with dependency injection based middleware wrappers

github.com/muir/nchiGo 1.23+ 5 dependenciesv0.2.0updated 3d ago

18

Foxby fox-toolkit

A high-performance HTTP router for building reverse proxies and API gateways, with first-class support for mutating routes at runtime.

github.com/fox-toolkit/foxGo 1.26+ 3 dependenciesv1.1.1updated 4d ago

14

fursyby coregx

HTTP router with type-safe generic handlers, automatic OpenAPI 3.1 generation from code, and RFC 9457 error responses.

github.com/coregx/fursyGo 1.27+ 2 dependenciesv0.7.0updated 24d ago

14

goroute

Simple yet powerful HTTP request multiplexer.

github.com/goroute/routeGo 1.13+ 1 dependencyv0.0.1updated 6y ago

9
Esc

Type to search every entry. ↑↓ to move, Enter to open.