For a lightweight HTTP router for Go, the strongest matches are julienschmidt/httprouter (This is a high-performance, zero-dependency HTTP router for Go), go-chi/chi (Chi is a lightweight, high-performance router that uses a) and gorilla/mux (This is a well-established HTTP request multiplexer for Go). gin-gonic/gin and labstack/echo round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
We curate open-source GitHub repositories matching “best go http router libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
httprouter is a high-performance HTTP request router for Go that maps incoming network requests to specific handler functions using a radix tree. It functions as a request dispatcher and path parameter parser, organizing URL paths in a tree structure to ensure efficient lookups. The router specializes in capturing dynamic segments and catch-all wildcards from URL paths to pass directly into request handlers. It implements method-specific routing and automatically manages responses for unsupported HTTP methods. The library covers broader capabilities including request normalization through tr
This is a high-performance, zero-dependency HTTP router for Go that uses a radix tree for efficient path matching and parameter extraction, making it a standard choice for idiomatic request multiplexing.
Chi is a lightweight, idiomatic router and middleware framework for building web services in Go. It is designed to integrate directly with the standard library, providing a set of utilities for managing HTTP request routing, context propagation, and modular service composition. The project distinguishes itself through a radix-tree-based routing system that supports recursive nesting, allowing developers to mount independent sub-routers onto specific path prefixes. This hierarchical structure enables the creation of organized, modular applications where request handlers are grouped and managed
Chi is a lightweight, high-performance router that uses a radix tree for efficient path matching and is designed to be fully compatible with the standard library's net/http interface.
This project is a request router and web framework for the Go programming language. It provides a toolkit for matching incoming HTTP network requests to specific handler functions by evaluating criteria such as URL paths, request methods, headers, and hostnames. The framework distinguishes itself through its flexible matching capabilities, which include support for regular expressions and dynamic variable extraction from URL segments. It allows developers to organize routes into logical hierarchies, share common path prefixes, and maintain a central registry of named routes to facilitate prog
This is a well-established HTTP request multiplexer for Go that provides robust routing, regex support, and middleware integration while maintaining compatibility with the standard library's http.Handler interface.
Gin is a web framework designed for building high-performance web services and APIs. It functions as a middleware-oriented engine that processes incoming HTTP requests through a sequential chain of handlers, allowing for the modular management of cross-cutting concerns such as authentication and logging. The framework utilizes a radix tree data structure to perform request routing, ensuring high-speed path matching with minimal memory overhead. It distinguishes itself by employing a zero-reflection dispatch mechanism that invokes handler functions through static type assertions, avoiding the
Gin is a high-performance web framework that includes a robust, radix-tree-based HTTP router and multiplexer, making it a suitable choice for developers needing efficient request handling and middleware support in Go.
Echo is a high-performance, lightweight web framework for Go designed for building scalable RESTful APIs and web services. It provides a centralized environment for mapping network requests to handler functions, utilizing a fast radix-tree routing engine to ensure efficient request dispatching. The framework is built around a modular, middleware-centric pipeline that allows developers to execute reusable logic for cross-cutting concerns like authentication, logging, and security across the entire application. What distinguishes Echo is its focus on developer productivity through structured da
Echo is a high-performance web framework that centers on a fast radix-tree router, providing the idiomatic request multiplexing and middleware support you need for building Go APIs.
go-restful is a framework for building RESTful web services in Go. It functions as a toolkit for managing API endpoints, providing a request router that maps incoming HTTP requests to handler functions using path parameters and custom URL patterns. The framework includes a data conversion layer that transforms Go structures into JSON or XML formats for request and response bodies. It also provides a system for organizing related web services into containers to manage endpoint prefixing and shared configuration. The project covers request lifecycle management through middleware filters for va
This is a comprehensive framework for building RESTful services in Go that includes a high-performance request router, middleware support, and standard library compatibility, making it a strong choice for managing complex API routing.
Martini is a web framework for the Go programming language that provides a toolkit for building web applications. It functions as a routing engine and an HTTP middleware pipeline to map network requests to specific handler functions. The framework is distinguished by its dependency injection system, which automatically resolves and provides requested service types as arguments to handler functions. This allows for the decoupling of business logic from infrastructure by matching requested types against a registry of available services. The project covers a broad range of web capabilities, inc
Martini is a mature web framework that provides a robust routing engine and middleware pipeline, making it a suitable choice for handling HTTP requests in Go despite its broader scope as a full-stack toolkit.
This is a high-performance HTTP routing library for Go that provides RESTful path parameter support, middleware chaining, and full compatibility with the standard library's http.Handler interface.
This is a high-performance, tree-based HTTP router for Go that supports RESTful path parameters and middleware, making it a direct fit for your routing requirements.
This is a lightweight, idiomatic HTTP multiplexer for Go that provides RESTful path parameters and pattern matching while maintaining compatibility with the standard library's http.Handler interface.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| julienschmidt/httprouter | 17.1K | Go | BSD-3-Clause | |
| go-chi/chi | 22.4K | Go | MIT | |
| gorilla/mux | 21.8K | Go | BSD-3-Clause | |
| gin-gonic/gin | 88.7K | Go | MIT | |
| labstack/echo | 32.5K | Go | MIT | |
| emicklei/go-restful | 5.1K | Go | MIT | |
| go-martini/martini | 11.6K | Go | MIT | |
| go-ozzo/ozzo-routing | 0 | — | — | — |
| dimfeld/httptreemux | 0 | — | — | — |
| go-zoo/bone | 0 | — | — | — |