# gorilla/mux

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/gorilla-mux).**

21,886 stars · 1,879 forks · Go · bsd-3-clause

## Links

- GitHub: https://github.com/gorilla/mux
- Homepage: https://gorilla.github.io
- awesome-repositories: https://awesome-repositories.com/repository/gorilla-mux.md

## Topics

`go` `golang` `gorilla` `gorilla-web-toolkit` `http` `middleware` `mux` `router`

## Description

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 programmatic URL generation and consistent link construction.

Beyond core routing, the library supports the execution of middleware chains to process requests before or after they reach their final destination. This enables the integration of reusable logic for tasks such as authentication, logging, and security header management. The framework also provides utilities for managing user sessions, handling cross-origin resource sharing, and establishing full-duplex communication channels for real-time data exchange.

## Tags

### Web Development

- [Request Routing](https://awesome-repositories.com/f/web-development/request-routing.md) — Matches incoming network requests to handler functions by evaluating URL paths, methods, and headers. ([source](https://cdn.jsdelivr.net/gh/gorilla/mux@main/README.md))
- [HTTP Handler Interfaces](https://awesome-repositories.com/f/web-development/http-handler-interfaces.md) — Routes incoming HTTP requests to handler functions by evaluating criteria like methods, headers, and hostnames.
- [HTTP Routers](https://awesome-repositories.com/f/web-development/http-routers.md) — Matches incoming network requests to handler functions based on URL paths, methods, and headers.
- [HTTP Routing](https://awesome-repositories.com/f/web-development/routing-systems/http-routing.md) — Directs incoming HTTP traffic to specific handler functions based on request methods and URL paths.
- [RESTful API Frameworks](https://awesome-repositories.com/f/web-development/restful-api-frameworks.md) — Provides a toolkit for building RESTful web services with routing and middleware support.
- [Route Grouping](https://awesome-repositories.com/f/web-development/route-grouping.md) — Organizes API endpoints into logical hierarchies with shared middleware and path prefixes.
- [Web Server Frameworks](https://awesome-repositories.com/f/web-development/web-server-frameworks.md) — Provides a toolkit for building web services with routing, middleware execution, and URL generation.
- [Middleware](https://awesome-repositories.com/f/web-development/middleware.md) — Wraps web requests with reusable logic like logging, compression, or security headers. ([source](https://gorilla.github.io))
- [Middleware Chains](https://awesome-repositories.com/f/web-development/middleware-chains.md) — Wraps request handlers in sequential function chains to process data before and after business logic execution.
- [RESTful API Development](https://awesome-repositories.com/f/web-development/restful-api-development.md) — Maps network requests to internal functions and manages dynamic URL parameters to expose structured RESTful services.
- [Route Handlers](https://awesome-repositories.com/f/web-development/route-handlers.md) — Parses dynamic segments from incoming URL paths and passes those values into handler functions. ([source](https://cdn.jsdelivr.net/gh/gorilla/mux@main/README.md))
- [Request Middleware](https://awesome-repositories.com/f/web-development/request-middleware.md) — Wraps request handlers with reusable logic to process data before or after reaching the final endpoint.
- [Route Naming Systems](https://awesome-repositories.com/f/web-development/routing-systems/routing/route-naming-systems.md) — Maintains a central registry of named routes to facilitate programmatic URL generation and consistent link construction.
- [URL Generators](https://awesome-repositories.com/f/web-development/url-generators.md) — Constructs valid web addresses from defined route patterns and variable inputs for consistent link generation. ([source](https://gorilla.github.io))
- [Real-Time Communication](https://awesome-repositories.com/f/web-development/real-time-communication.md) — Establishes persistent, full-duplex connections for real-time data exchange between clients and servers.
- [Form Data Support](https://awesome-repositories.com/f/web-development/form-data-support.md) — Converts incoming form data into structured objects and serializes objects back into form values. ([source](https://gorilla.github.io))
- [RPC Service Mappers](https://awesome-repositories.com/f/web-development/rpc-service-mappers.md) — Maps incoming web requests to specific object methods to allow external clients to trigger internal functions. ([source](https://gorilla.github.io))
- [URL Construction](https://awesome-repositories.com/f/web-development/url-construction.md) — Constructs consistent web addresses from route patterns to ensure reliable link generation throughout the application.

### Development Tools & Productivity

- [Path Variable Extractors](https://awesome-repositories.com/f/development-tools-productivity/dynamic-variable-evaluators/path-variable-extractors.md) — Parses dynamic URL path segments into handler function arguments for flexible request processing.
- [Regex Path Matchers](https://awesome-repositories.com/f/development-tools-productivity/path-matching-tools/regex-path-matchers.md) — Matches incoming request paths against pre-compiled regular expressions to determine the appropriate handler.

### Security & Cryptography

- [Session & Cookie Handlers](https://awesome-repositories.com/f/security-cryptography/session-cookie-handlers.md) — Maintains user state across stateless HTTP requests by encoding and decoding data into secure browser cookies.
- [Custom Session Storage Providers](https://awesome-repositories.com/f/security-cryptography/identity-access-management/session-management/custom-session-storage-providers.md) — Maintains state across multiple HTTP requests using cookie or filesystem storage with support for custom backends. ([source](https://gorilla.github.io))
- [Cross-Site Request Forgery Protections](https://awesome-repositories.com/f/security-cryptography/cross-site-request-forgery-protections.md) — Validates incoming requests against cross-site request forgery attacks by verifying security tokens within middleware. ([source](https://gorilla.github.io))
- [Exposed Header Configurations](https://awesome-repositories.com/f/security-cryptography/security-headers/exposed-header-configurations.md) — Configures response headers automatically based on defined HTTP methods to simplify cross-origin requests. ([source](https://cdn.jsdelivr.net/gh/gorilla/mux@main/README.md))
- [Cookie Security](https://awesome-repositories.com/f/security-cryptography/cookie-security.md) — Provides secure cookie handling with authentication and encryption to prevent tampering and unauthorized access. ([source](https://gorilla.github.io))

### Networking & Communication

- [WebSocket Servers](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-computing/communication-protocols/websocket-implementations/websocket-servers.md) — Establishes full-duplex communication links between clients and servers for real-time data exchange. ([source](https://gorilla.github.io))
- [URL Utilities](https://awesome-repositories.com/f/networking-communication/url-utilities.md) — Parses dynamic segments from web addresses and maps them to specific application logic or controller methods.
