{"id":36674232,"url":"https://github.com/tigerwill90/fox","last_synced_at":"2026-01-31T14:00:58.248Z","repository":{"id":63820158,"uuid":"514251462","full_name":"tigerwill90/fox","owner":"tigerwill90","description":"A high-performance Go HTTP router for building reverse proxies and API gateways, including use cases like ingress controllers","archived":false,"fork":false,"pushed_at":"2026-01-08T22:39:03.000Z","size":8599,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-10T18:23:21.917Z","etag":null,"topics":["fox","go","golang","http-router","http-server","middleware","mux","performance","router","server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tigerwill90.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-07-15T11:52:31.000Z","updated_at":"2026-01-08T22:35:41.000Z","dependencies_parsed_at":"2024-02-14T09:38:07.250Z","dependency_job_id":"0872d593-dcc9-45f1-9e34-73b030fecd5e","html_url":"https://github.com/tigerwill90/fox","commit_stats":{"total_commits":35,"total_committers":3,"mean_commits":"11.666666666666666","dds":"0.34285714285714286","last_synced_commit":"eea87e74f78fccae69743631c27e41d54c4b6d60"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/tigerwill90/fox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tigerwill90%2Ffox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tigerwill90%2Ffox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tigerwill90%2Ffox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tigerwill90%2Ffox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tigerwill90","download_url":"https://codeload.github.com/tigerwill90/fox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tigerwill90%2Ffox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28944789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T13:02:32.153Z","status":"ssl_error","status_checked_at":"2026-01-31T13:00:07.528Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fox","go","golang","http-router","http-server","middleware","mux","performance","router","server"],"created_at":"2026-01-12T10:47:09.340Z","updated_at":"2026-01-31T14:00:58.222Z","avatar_url":"https://github.com/tigerwill90.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fox\n\n\u003cimg align=\"right\" width=\"159px\" src=\"https://raw.githubusercontent.com/tigerwill90/fox/refs/heads/static/fox_logo.png\"\u003e\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/tigerwill90/fox.svg)](https://pkg.go.dev/github.com/tigerwill90/fox)\n[![tests](https://github.com/tigerwill90/fox/actions/workflows/tests.yaml/badge.svg)](https://github.com/tigerwill90/fox/actions?query=workflow%3Atests)\n[![Go Report Card](https://goreportcard.com/badge/github.com/tigerwill90/fox)](https://goreportcard.com/report/github.com/tigerwill90/fox)\n[![codecov](https://codecov.io/gh/tigerwill90/fox/branch/master/graph/badge.svg?token=09nfd7v0Bl)](https://codecov.io/gh/tigerwill90/fox)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/tigerwill90/fox)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/tigerwill90/fox)\n\nFox is a lightweight and high performance HTTP request router for [Go](https://go.dev/), designed for building reverse proxies,\nAPI gateways, or other applications that require managing routes at runtime based on configuration changes or external events.\nIt is also well-suited for general use cases such as microservices and REST APIs, though it focuses on routing and does not include \nconvenience helpers found in full-featured frameworks, such as automatic binding, content negotiation, file uploads, cookies, etc.\n\nFox supports **mutation on its routing tree while handling requests concurrently**. Internally, it uses a Radix Tree that supports\n**lock-free** reads while allowing a concurrent writer, and is optimized for high-concurrency reads and low-concurrency writes.\nThe router supports complex routing patterns, enforces clear priority rules, and performs strict validation to prevent misconfigurations.\n\n## Disclaimer\nThe current api is not yet stabilize. Breaking changes may occur before `v1.0.0` and will be noted on the release note.\n\n## Features\n**Runtime updates:** Register, update and delete route handler safely at any time without impact on performance.\n\n**Flexible routing:** Fox strikes a balance between routing flexibility, performance and clarity by enforcing clear priority rules, ensuring that\nthere are no unintended matches and maintaining high performance even for complex routing patterns. Supported features include named parameters,\nsuffix and infix catch-all, regexp constraints, hostname matching, method and method-less routes, route matchers, and sub-routers.\n\n**Trailing slash handling:** Automatically handle trailing slash inconsistencies by either ignoring them, redirecting to \nthe canonical path, or enforcing strict matching based on your needs.\n\n**Path correction:** Automatically handle malformed paths with extra slashes or dots by either serving the cleaned path directly or redirecting to the canonical form.\n\n**Automatic OPTIONS replies:** Fox has built-in native support for [OPTIONS requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS).\n\n**Client IP Derivation:** Accurately determine the \"real\" client IP address using best practices tailored to your network topology.\n\n**Rich middleware ecosystem:** Fox offers a robust ecosystem of prebuilt, high-quality middlewares, ready to integrate into your application.\n\n---\n* [Getting started](#getting-started)\n  * [Install](#install)\n  * [Basic example](#basic-example)\n  * [Named parameters](#named-parameters)\n  * [Named wildcards](#named-wildcards-catch-all)\n  * [Optional Named wildcards](#optional-named-wildcards-catch-all)\n  * [Route matchers](#route-matchers)\n  * [Method-less routes](#method-less-routes)\n  * [Sub-Routers](#sub-routers)\n  * [Hostname validation \u0026 restrictions](#hostname-validation--restrictions)\n  * [Priority rules](#priority-rules)\n    * [Hostname routing](#hostname-routing)\n  * [Warning about context](#warning-about-context)\n* [Concurrency](#concurrency)\n  * [Managing routes a runtime](#managing-routes-a-runtime)\n  * [ACID Transaction](#acid-transaction)\n  * [Managed read-write transaction](#managed-read-write-transaction)\n  * [Unmanaged read-write transaction](#unmanaged-read-write-transaction)\n  * [Managed read-only transaction](#managed-read-only-transaction)\n* [Middleware](#middleware)\n  * [Official middlewares](#official-middlewares)\n* [Working with http.Handler](#working-with-httphandler)\n* [Handling OPTIONS Requests and CORS Automatically](#handling-options-requests-and-cors-automatically)\n* [Resolving Client IP](#resolving-client-ip)\n* [Benchmark](#benchmark)\n* [Road to v1](#road-to-v1)\n* [Contributions](#contributions)\n* [License](#license)\n---\n\n## Getting started\n#### Install\nWith a [correctly configured](https://go.dev/doc/install#testing) Go toolchain:\n```shell\ngo get -u github.com/tigerwill90/fox\n```\n\n#### Basic example\n````go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/tigerwill90/fox\"\n)\n\nfunc HelloServer(c *fox.Context) {\n\t_ = c.String(http.StatusOK, fmt.Sprintf(\"Hello %s\\n\", c.Param(\"name\")))\n}\n\nfunc main() {\n\tf := fox.MustRouter(fox.DefaultOptions())\n\n\tf.MustAdd([]string{http.MethodHead, http.MethodGet}, \"/hello/{name}\", HelloServer)\n\n\tif err := http.ListenAndServe(\":8080\", f); err != nil \u0026\u0026 !errors.Is(err, http.ErrServerClosed) {\n\t\tlog.Fatalln(err)\n\t}\n}\n````\n\n#### Named parameters\nRoutes can include named parameters using curly braces `{name}` to match exactly one non-empty route segment. The matching \nsegment are recorder as [Param](https://pkg.go.dev/github.com/tigerwill90/fox#Param) and accessible via the \n[Context](https://pkg.go.dev/github.com/tigerwill90/fox#Context). Named parameters are supported anywhere in \nthe route, but only one parameter is allowed per segment (or hostname label) and must appear at the end of the segment.\n\n````\nPattern /avengers/{name}\n\n/avengers/ironman               matches\n/avengers/thor                  matches\n/avengers/hulk/angry            no matches\n/avengers/                      no matches\n\nPattern /users/uuid:{id}\n\n/users/uuid:123                 matches\n/users/uuid:                    no matches\n\nPattern /users/uuid:{id}/config\n\n/users/uuid:123/config          matches\n/users/uuid:/config             no matches\n\nPattern {sub}.example.com/avengers\n\nfirst.example.com/avengers      matches\nexample.com/avengers           no matches\n````\n\nNamed parameters can include regular expression using the syntax `{name:regexp}`. Regular expressions cannot \ncontain capturing groups, but can use non-capturing groups `(?:pattern)` instead. Regexp support is opt-in via\n`fox.AllowRegexpParam(true)` option.\n\n````\nPattern /products/{name:[A-Za-z]+}\n\n/products/laptop        matches\n/products/123           no matches\n````\n\n#### Named Wildcards (Catch-all)\nNamed wildcard start with a plus sign `+` followed by a name `{param}` and match any sequence of characters\nincluding slashes, but cannot match an empty string. The matching segment are also accessible via\n[Context](https://pkg.go.dev/github.com/tigerwill90/fox#Context). Catch-all parameters are supported anywhere in the route,\nbut only one parameter is allowed per segment (or hostname label) and must appear at the end of the segment.\nConsecutive catch-all parameter are not allowed.\n\n````\nPattern /src/+{filepath}\n\n/src/conf.txt                      matches\n/src/dir/config.txt                 matches\n/src/                              no matches\n\nPattern /src/file=+{path}\n\n/src/file=config.txt                 matches\n/src/file=/dir/config.txt            matches\n/src/file=                          no matches\n\nPattern: /assets/+{path}/thumbnail\n\n/assets/images/thumbnail           matches\n/assets/photos/2021/thumbnail      matches\n/assets//thumbnail                 no matches\n\nPattern +{sub}.example.com/avengers\n\nfirst.example.com/avengers          matches\nfirst.second.example.com/avengers   matches\nexample.com/avengers               no matches\n````\n\n#### Optional Named Wildcards (Catch-all)\nOptional named wildcard start with an asterisk `*` followed by a name `{param}` and match any sequence of characters\n**including empty** strings. Unlike `+{param}`, optional wildcards can only be used as a suffix.\n\n````\nPattern /src/*{filepath}\n\n/src/conf.txt                      matches\n/src/dir/config.txt                 matches\n/src/                              matches\n\nPattern /src/file=*{path}\n\n/src/file=config.txt                 matches\n/src/file=/dir/config.txt            matches\n/src/file=                          matches\n````\n\nNamed wildcard can include regular expression using the syntax `+{name:regexp}` or `*{name:regexp}`. Regular expressions cannot\ncontain capturing groups, but can use non-capturing groups `(?:pattern)` instead. Regexp support is opt-in via `fox.AllowRegexpParam(true)` option.\n\n````\nPattern /src/+{filepath:[A-Za-z/]+\\.json}\n\n/src/dir/config.json            matches\n/src/dir/config.txt             no matches\n````\n\n#### Route matchers\n\nRoute matchers enable routing decisions based on request properties beyond methods, hostname and path. Multiple routes can share\nthe same pattern and methods and be differentiated by query parameters, headers, client IP, or custom criteria.\n\n````go\nf.MustAdd(fox.MethodGet, \"/api/users\", PremiumHandler, fox.WithQueryMatcher(\"tier\", \"premium\"))\nf.MustAdd(fox.MethodGet, \"/api/users\", StandardHandler, fox.WithHeaderMatcher(\"X-API-Version\", \"v2\"))\nf.MustAdd(fox.MethodGet, \"/api/users\", DefaultHandler) // Fallback route\n````\n\nBuilt-in matchers include `fox.WithQueryMatcher`, `fox.WithQueryRegexpMatcher`, `fox.WithHeaderMatcher`, `fox.WithHeaderRegexpMatcher`,\nand `fox.WithClientIPMatcher`. Multiple matchers on a route use AND logic. Routes without matchers serve as fallbacks.\nFor custom matching logic, implement the `fox.Matcher` interface and use `fox.WithMatcher`. See [Priority rules](#priority-rules) for matcher\nevaluation order.\n\n#### Method-less routes\n\nRoutes can be registered without specifying an HTTP method to match any method. The constant `fox.MethodAny` is\na convenience placeholder equivalent to an empty method set (nil or empty slice).\n\n````go\n// Handle any method on /health\nf.MustAdd(fox.MethodAny, \"/health\", HealthHandler)\n// Forward all requests to a backend service\nf.MustAdd(fox.MethodAny, \"/api/*{any}\", ProxyHandler)\n````\n\nRoutes registered with a specific HTTP method always take precedence over method-less routes. This allows defining method-specific\nbehavior while falling back to a generic handler for other methods.\n````go\n// Specific handler for GET requests\nf.MustAdd(fox.MethodGet, \"/resource\", GetHandler)\n// All other methods handled here\nf.MustAdd(fox.MethodAny, \"/resource\", FallbackHandler)\n````\n\n#### Sub-Routers\nFox provides a composable routing API where routers can be mounted as regular routes, each with its own middleware and configuration.\n\n```go\napi := fox.MustRouter(fox.WithMiddleware(AuthMiddleware()))\napi.MustAdd([]string{http.MethodHead, http.MethodGet}, \"/\", HelloHandler)\napi.MustAdd([]string{http.MethodHead, http.MethodGet}, \"/users\", ListUser)\napi.MustAdd([]string{http.MethodHead, http.MethodGet}, \"/users/{id}\", GetUser)\napi.MustAdd(fox.MethodPost, \"/users\", CreateUser)\n\nf := fox.MustRouter(fox.DefaultOptions())\nf.MustAdd([]string{http.MethodHead, http.MethodGet}, \"/*{filepath}\", fox.WrapH(http.FileServer(http.Dir(\"./public/\"))))\nf.MustAdd(fox.MethodAny, \"/api*{mount}\", fox.Sub(api))\n```\n\nRequests matching the prefix are delegated to the mounted router with the remaining path.\n\nUse cases include:\n- Applying middleware, matchers or other configuration to a routing prefix\n- Managing entire route subtree at runtime (e.g. insert, update, or delete via the parent router)\n- Organizing routes into groups with shared configuration\n\n#### Hostname validation \u0026 restrictions\n\nHostnames are validated to conform to the [LDH (letters, digits, hyphens) rule](https://datatracker.ietf.org/doc/html/rfc3696.html#section-2)\n(lowercase only) and SRV-like \"underscore labels\". Wildcard segments within hostnames, such as `{sub}.example.com/`, are exempt from LDH validation\nsince they act as placeholders rather than actual domain labels. As such, they do not count toward the hard limit of 63 characters per label,\nnor the 255-character limit for the full hostname (including periods). Internationalized domain names (IDNs) should be specified using an ASCII\n(Punycode) representation.\n\nThe DNS specification permits a trailing period to be used to denote the root, e.g., `example.com` and `example.com.` are equivalent,\nbut the latter is more explicit and is required to be accepted by applications. Fox will reject route registered with\ntrailing period. However, the router will automatically strip any trailing period from incoming request host so it can match\nthe route regardless of a trailing period. Note that FQDN (with trailing period) does not play well with golang\nTLS stdlib (see traefik/traefik#9157 (comment)).\n\n#### Priority rules\n\nThe router is designed to balance routing flexibility, performance, and predictability. Internally, it uses a radix tree to\nstore routes efficiently. When a request arrives, Fox evaluates routes in the following order:\n\n1. **Hostname matching**\n    - Routes with hostnames are evaluated before path-only routes\n\n2. **Pattern matching** (longest match, most specific first)\n    - Static segments\n    - Named parameters with regex constraints\n    - Named parameters without constraints\n    - Catch-all parameters with regex constraints\n    - Catch-all parameters without constraints\n    - Infix catch-all are evaluated before suffix catch-all (e.g., `/bucket/+{path}/meta` before `/bucket/+{path}`)\n    - At the same level, multiple regex-constrained parameters are evaluated in registration order\n\n3. **Method matching**\n    - Routes with specific methods are evaluated before method-less routes\n\n4. **Matcher evaluation** (for routes sharing the same pattern and overlapping methods)\n    - Routes with matchers are evaluated before routes without\n    - Among routes with matchers, higher priority is evaluated first (configurable via `fox.WithMatcherPriority`, or defaults to the number of matchers)\n    - Routes with equal priority may be evaluated in any order\n\nIf a match candidate fails to complete the full route, including matchers, Fox returns to the last decision point and tries the next available\nalternative following the same priority order.\n\n##### Hostname routing\n\nThe router can transition instantly and transparently from path-only mode to hostname-prioritized mode without any \nadditional configuration or action. If any route with a hostname is registered, the router automatically switches to \nprioritize hostname matching. Conversely, if no hostname-specific routes are registered, the router reverts to \npath-priority mode.\n\n- If the router has no routes registered with hostnames, the router will perform a path-based lookup only.\n- If the router includes at least one route with a hostname, the router will prioritize lookup based \non the request host and path. If no match is found, the router will then fall back to a path-only lookup.\n\nHostname matching is **case-insensitive**, so requests to `Example.COM`, `example.com`, and `EXAMPLE.COM` will all match a route registered for `example.com`.\n\n#### Warning about context\nThe `fox.Context` instance is freed once the request handler function returns to optimize resource allocation.\nIf you need to retain `fox.Context` beyond the scope of the handler, use the `fox.Context.Clone` methods.\n````go\nfunc Hello(c *fox.Context) {\n    cc := c.Clone()\n    go func() {\n        time.Sleep(2 * time.Second)\n        log.Println(cc.Param(\"name\")) // Safe\n    }()\n    _ = c.String(http.StatusOK, \"Hello %s\\n\", c.Param(\"name\"))\n}\n````\n\n## Concurrency\nFox implements an immutable Radix Tree that supports lock-free read while allowing a single writer to make progress.\nUpdates are applied by calculating the change which would be made to the tree were it mutable, assembling those changes\ninto a **patch** which is propagated to the root and applied in a **single atomic operation**. The result is a shallow copy \nof the tree, where only the modified path and its ancestors are cloned, ensuring minimal memory overhead.\nMultiple patches can be applied in a single transaction, with intermediate nodes cached during the process to prevent \nredundant cloning.\n\n### Other key points\n\n- Routing requests is lock-free (reading thread never block, even while writes are ongoing)\n- The router always see a consistent version of the tree while routing request\n- Reading threads do not block writing threads (adding, updating or removing a handler can be done concurrently)\n- Writing threads block each other but never block reading threads\n\nAs such threads that route requests should never encounter latency due to ongoing writes or other concurrent readers.\n\n### Managing routes a runtime\n#### Routing mutation\nIn this example, the handler for `routes/{action}` allow to dynamically register, update and delete handler for the\ngiven route and method. Thanks to Fox's design, those actions are perfectly safe and may be executed concurrently.\n\n````go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/tigerwill90/fox\"\n)\n\ntype Data struct {\n\tPattern string   `json:\"pattern\"`\n\tMethods []string `json:\"methods\"`\n\tText    string   `json:\"text\"`\n}\n\nfunc Action(c *fox.Context) {\n\tdata := new(Data)\n\tif err := json.NewDecoder(c.Request().Body).Decode(data); err != nil {\n\t\thttp.Error(c.Writer(), err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tvar err error\n\taction := c.Param(\"action\")\n\tswitch action {\n\tcase \"add\":\n\t\t_, err = c.Router().Add(data.Methods, data.Pattern, func(c *fox.Context) {\n\t\t\t_ = c.String(http.StatusOK, data.Text)\n\t\t})\n\tcase \"update\":\n\t\t_, err = c.Router().Update(data.Methods, data.Pattern, func(c *fox.Context) {\n\t\t\t_ = c.String(http.StatusOK, data.Text)\n\t\t})\n\tcase \"delete\":\n\t\t_, err = c.Router().Delete(data.Methods, data.Pattern)\n\tdefault:\n\t\thttp.Error(c.Writer(), fmt.Sprintf(\"action %q is not allowed\", action), http.StatusBadRequest)\n\t\treturn\n\t}\n\tif err != nil {\n\t\thttp.Error(c.Writer(), err.Error(), http.StatusConflict)\n\t\treturn\n\t}\n\n\t_ = c.String(http.StatusOK, fmt.Sprintf(\"%s route [%s] %s: success\\n\", action, strings.Join(data.Methods, \",\"), data.Pattern))\n}\n\nfunc main() {\n\tf := fox.MustRouter(fox.DefaultOptions())\n\n\tf.MustAdd(fox.MethodPost, \"/routes/{action}\", Action)\n\n\tif err := http.ListenAndServe(\":8080\", f); err != nil \u0026\u0026 !errors.Is(err, http.ErrServerClosed) {\n\t\tlog.Fatalln(err)\n\t}\n}\n````\n\n#### ACID Transaction\nFox supports read-write and read-only transactions (with Atomicity, Consistency, and Isolation; Durability is not supported \nas transactions are in memory). Thread that route requests always see a consistent version of the routing tree and are \nfully isolated from an ongoing transaction until committed. Read-only transactions capture a point-in-time snapshot of \nthe tree, ensuring they do not observe any ongoing or committed changes made after their creation.\n\n#### Managed read-write transaction\n````go\n// Updates executes a function within the context of a read-write managed transaction. If no error is returned\n// from the function then the transaction is committed. If an error is returned then the entire transaction is\n// aborted.\nif err := f.Updates(func(txn *fox.Txn) error {\n\tif _, err := txn.Add(fox.MethodGet, \"exemple.com/hello/{name}\", Handler); err != nil {\n\t\treturn err\n\t}\n\n\t// Iter returns a collection of range iterators for traversing registered routes.\n\tit := txn.Iter()\n\t// When Iter() is called on a write transaction, it creates a point-in-time snapshot of the transaction state.\n\t// It means that writing on the current transaction while iterating is allowed, but the mutation will not be\n\t// observed in the result returned by PatternPrefix (or any other iterator).\n\tfor route := range it.PatternPrefix(\"tmp.exemple.com/\") {\n\t\tif _, err := txn.Delete(slices.Collect(route.Methods()), route.Pattern()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}); err != nil {\n\tlog.Printf(\"transaction aborted: %s\", err)\n}\n````\n\n#### Managed read-only transaction\n````go\n_ = f.View(func(txn *fox.Txn) error {\n\tif txn.Has(fox.MethodGet, \"/foo\") {\n\t\tif txn.Has(fox.MethodGet, \"/bar\") {\n\t\t\t// do something\n\t\t}\n\t}\n\treturn nil\n})\n````\n\n#### Unmanaged read-write transaction\n````go\n// Txn create an unmanaged read-write or read-only transaction.\ntxn := f.Txn(true)\ndefer txn.Abort()\n\nif _, err := txn.Add(fox.MethodGet, \"exemple.com/hello/{name}\", Handler); err != nil {\n\tlog.Printf(\"error inserting route: %s\", err)\n\treturn\n}\n\n// Iter returns a collection of range iterators for traversing registered routes.\nit := txn.Iter()\n// When Iter() is called on a write transaction, it creates a point-in-time snapshot of the transaction state.\n// It means that writing on the current transaction while iterating is allowed, but the mutation will not be\n// observed in the result returned by PatternPrefix (or any other iterator).\nfor route := range it.PatternPrefix(\"tmp.exemple.com/\") {\n\tif _, err := txn.Delete(slices.Collect(route.Methods()), route.Pattern()); err != nil {\n\t\tlog.Printf(\"error deleting route: %s\", err)\n\t\treturn\n\t}\n}\n// Finalize the transaction\ntxn.Commit()\n````\n\n## Middleware\nMiddlewares can be registered globally using the `fox.WithMiddleware` option. The example below demonstrates how \nto create and apply automatically a simple logging middleware to all routes (including 404, 405, etc...).\n\n````go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/tigerwill90/fox\"\n)\n\nfunc Logger(next fox.HandlerFunc) fox.HandlerFunc {\n\treturn func(c *fox.Context) {\n\t\tstart := time.Now()\n\t\tnext(c)\n\t\tlog.Printf(\"route: %s, latency: %s, status: %d, size: %d\",\n\t\t\tc.Pattern(),\n\t\t\ttime.Since(start),\n\t\t\tc.Writer().Status(),\n\t\t\tc.Writer().Size(),\n\t\t)\n\t}\n}\n\nfunc main() {\n\tf := fox.MustRouter(fox.WithMiddleware(Logger))\n\n\tf.MustAdd(fox.MethodGet, \"/\", func(c *fox.Context) {\n\t\t_ = c.String(http.StatusOK, \"Hello World\")\n\t})\n\n\tlog.Fatalln(http.ListenAndServe(\":8080\", f))\n}\n````\n\nAdditionally, `fox.WithMiddlewareFor` option provide a more fine-grained control over where a middleware is applied, such as\nonly for 404 or 405 handlers. Possible scopes include `fox.RouteHandlers` (regular routes), `fox.NoRouteHandler`, `fox.NoMethodHandler`, \n`fox.RedirectSlashHandler`, `fox.RedirectPathHandler`, `fox.OptionsHandler` and any combination of these.\n\n````go\nf  := fox.MustRouter(\n\tfox.WithMiddlewareFor(fox.RouteHandler, Logger),\n\tfox.WithMiddlewareFor(fox.NoRouteHandler|fox.NoMethodHandler, SpecialLogger),\n)\n````\n\nFinally, it's also possible to attaches middleware on a per-route basis. Note that route-specific middleware must be explicitly reapplied \nwhen updating a route. If not, any middleware will be removed, and the route will fall back to using only global middleware (if any).\n\n````go\nf := fox.MustRouter(\n\tfox.WithMiddleware(fox.Logger(slog.NewTextHandler(os.Stdout, nil))),\n)\nf.MustAdd(fox.MethodGet, \"/\", SomeHandler, fox.WithMiddleware(foxtimeout.Middleware(2*time.Second)))\nf.MustAdd(fox.MethodGet, \"/foo\", SomeOtherHandler)\n````\n\n### Official middlewares\n* [tigerwill90/otelfox](https://github.com/tigerwill90/otelfox): Distributed tracing with [OpenTelemetry](https://opentelemetry.io/)\n* [tigerwill90/foxdump](https://github.com/tigerwill90/foxdump): Body dump middleware for capturing requests and responses payload.\n* [tigerwill90/foxtimeout](https://github.com/tigerwill90/foxtimeout): `http.TimeoutHandler` middleware optimized for Fox.\n* [tigerwill90/foxwaf](https://github.com/tigerwill90/foxwaf): Coraza WAF middleware (experimental).\n* [tigerwill90/foxgeoip](https://github.com/tigerwill90/foxgeoip): Block requests using GeoIP data based on client IP (experimental).\n\n## Working with http.Handler\nFox itself implements the `http.Handler` interface which make easy to chain any compatible middleware before the router. Moreover, the router\nprovides convenient `fox.WrapF`, `fox.WrapH` and `fox.WrapM` adapter to be use with `http.Handler`.\n\nThe route parameters can be accessed by the wrapped handler through the request `context.Context` when the adapters are used.\n\nWrapping an `http.Handler`\n````go\narticles := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\tparams := fox.ParamsFromContext(r.Context())\n\t// Article id: 80\n\t// Matched route: /articles/{id}\n\t_, _ = fmt.Fprintf(w, \"Article id: %s\\nMatched route: %s\\n\", params.Get(\"id\"), r.Pattern)\n})\n\nf := fox.MustRouter()\nf.MustAdd(fox.MethodGet, \"/articles/{id}\", fox.WrapH(articles))\n````\n\nWrapping any standard `http.Hanlder` middleware\n````go\ncorsMw, _ := cors.NewMiddleware(cors.Config{\n\tOrigins:        []string{\"https://example.com\"},\n\tMethods:        []string{http.MethodGet, http.MethodPost, http.MethodPut},\n\tRequestHeaders: []string{\"Authorization\"},\n})\n\nf := fox.MustRouter(\n\tfox.WithMiddlewareFor(fox.RouteHandler|fox.OptionsHandler, fox.WrapM(corsMw.Wrap)),\n)\n````\n\n## Handling OPTIONS Requests and CORS Automatically\nThe `WithAutoOptions` setting or the `WithOptionsHandler` registration enable automatic responses to [OPTIONS requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/OPTIONS).\nThis feature is particularly useful for handling Cross-Origin Resource Sharing (CORS) preflight requests.\n\nWhen automatic OPTIONS responses is enabled, Fox distinguishes between regular OPTIONS requests and CORS preflight requests:\n- **Regular OPTIONS requests:** The router responds with the `Allow` header populated with all HTTP methods registered for the matched resource. If no route matches, the `NoRoute` handler is called.\n- **CORS preflight requests:** The router responds to every preflight request by calling the OPTIONS handler, regardless of whether the resource exists.\n\nTo customize how OPTIONS requests are handled (e.g. adding CORS headers), you may register a middleware for the `fox.OptionsHandler` scope\nor provide a custom handler via `WithOptionsHandler`. Note that custom OPTIONS handlers always take priority over automatic replies.\n\n````go\npackage main\n\nimport (\n\t\"errors\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/jub0bs/cors\"\n\t\"github.com/tigerwill90/fox\"\n)\n\nfunc main() {\n\tcorsMw, err := cors.NewMiddleware(cors.Config{\n\t\tOrigins:        []string{\"https://example.com\"},\n\t\tMethods:        []string{http.MethodGet, http.MethodPost},\n\t\tRequestHeaders: []string{\"Authorization\"},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tcorsMw.SetDebug(true) // turn debug mode on (optional)\n\n\tf := fox.MustRouter(\n\t\tfox.WithAutoOptions(true), // let Fox automatically handle OPTIONS requests\n\t\tfox.WithMiddlewareFor(fox.RouteHandler|fox.OptionsHandler, fox.WrapM(corsMw.Wrap)),\n\t)\n\n\tf.MustAdd(fox.MethodGet, \"/api/users\", ListUsers)\n\tf.MustAdd(fox.MethodPost, \"/api/users\", CreateUsers)\n\n\tif err := http.ListenAndServe(\":8080\", f); !errors.Is(err, http.ErrServerClosed) {\n\t\tlog.Fatal(err)\n\t}\n}\n````\n\nAlternatively, you can use a sub-router to apply CORS only to a specific section of your API. This approach is useful when\nyou want to serve static files or other routes without CORS handling, while enabling it exclusively for API endpoints.\n\n````go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/jub0bs/cors\"\n\t\"github.com/tigerwill90/fox\"\n)\n\nfunc main() {\n\tcorsMw, err := cors.NewMiddleware(cors.Config{\n\t\tOrigins:        []string{\"https://example.com\"},\n\t\tMethods:        []string{http.MethodGet, http.MethodGet, http.MethodPost},\n\t\tRequestHeaders: []string{\"Authorization\"},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tcorsMw.SetDebug(true) // turn debug mode on (optional)\n\n\tf := fox.MustRouter()\n\tf.MustAdd([]string{http.MethodHead, http.MethodGet}, \"/*{filepath}\", fox.WrapH(http.FileServer(http.Dir(\"./public/\"))))\n\n\tapi := fox.MustRouter(\n\t\tfox.WithAutoOptions(true), // let Fox automatically handle OPTIONS requests\n\t\tfox.WithMiddlewareFor(fox.RouteHandler|fox.OptionsHandler, fox.WrapM(corsMw.Wrap)),\n\t)\n\tapi.MustAdd([]string{http.MethodHead, http.MethodGet}, \"/users\", ListUsers)\n\tapi.MustAdd(fox.MethodPost, \"/users\", CreateUser)\n\n\tf.MustAdd(fox.MethodAny, \"/api*{any}\", fox.Sub(api)) // Method-less route\n}\n````\n\nThe CORS protocol is complex and security-sensitive. We do **NOT** recommend implementing CORS handling manually. Instead,\nconsider using [jub0bs/cors](https://github.com/jub0bs/cors), which performs extensive validation before allowing middleware creation, helping you avoid common pitfalls.\n\n## Resolving Client IP\nThe `WithClientIPResolver` option allows you to set up strategies to resolve the client IP address based on your \nuse case and network topology. Accurately determining the client IP is hard, particularly in environments with proxies or \nload balancers. For example, the leftmost IP in the `X-Forwarded-For` header is commonly used and is often regarded as the \n\"closest to the client\" and \"most real,\" but it can be easily spoofed. Therefore, you should absolutely avoid using it \nfor any security-related purposes, such as request throttling.\n\nThe resolver used must be chosen and tuned for your network configuration. This should result in a resolver never returning \nan error and if it does, it should be treated as an application issue or a misconfiguration, rather than defaulting to an \nuntrustworthy IP.\n\nThe sub-package `github.com/tigerwill90/fox/clientip` provides a set of best practices resolvers that should cover most use cases.\n\n````go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tigerwill90/fox\"\n\t\"github.com/tigerwill90/fox/clientip\"\n)\n\nfunc main() {\n\tresolver, err := clientip.NewRightmostNonPrivate(clientip.XForwardedForKey)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tf := fox.MustRouter(\n\t\tfox.DefaultOptions(),\n\t\tfox.WithClientIPResolver(\n\t\t\tresolver,\n\t\t),\n\t)\n\n\tf.MustAdd(fox.MethodGet, \"/foo/bar\", func(c *fox.Context) {\n\t\tipAddr, err := c.ClientIP()\n\t\tif err != nil {\n\t\t\t// If the current resolver is not able to derive the client IP, an error\n\t\t\t// will be returned rather than falling back on an untrustworthy IP. It\n\t\t\t// should be treated as an application issue or a misconfiguration.\n\t\t\tpanic(err)\n\t\t}\n\t\tfmt.Println(ipAddr.String())\n\t})\n}\n````\n\nIt is also possible to create a chain with multiple resolvers that attempt to derive the client IP, stopping when the first one succeeds.\n\n````go\nresolver, _ := clientip.NewLeftmostNonPrivate(clientip.ForwardedKey, 10)\nf := fox.MustRouter(\n\tfox.DefaultOptions(),\n\tfox.WithClientIPResolver(\n\t\t// A common use for this is if a server is both directly connected to the\n\t\t// internet and expecting a header to check.\n\t\tclientip.NewChain(\n\t\t\tresolver,\n\t\t\tclientip.NewRemoteAddr(),\n\t\t),\n\t),\n)\n````\n\nNote that there is no \"sane\" default strategy, so calling `Context.ClientIP` without a resolver configured will return \nan `ErrNoClientIPResolver`.\n\nSee this [blog post](https://adam-p.ca/blog/2022/03/x-forwarded-for/) for general guidance on choosing a strategy that fit your needs.\n\n## Benchmark\nThe primary goal of Fox is to be a lightweight, high performance router which allow routes modification at runtime.\nThe following benchmarks attempt to compare Fox to various popular alternatives, including both fully-featured web frameworks\nand lightweight request routers. These benchmarks are based on the [julienschmidt/go-http-routing-benchmark](https://github.com/julienschmidt/go-http-routing-benchmark) \nrepository.\n\nPlease note that these benchmarks should not be taken too seriously, as the comparison may not be entirely fair due to \nthe differences in feature sets offered by each framework. Performance should be evaluated in the context of your specific \nuse case and requirements. While Fox aims to excel in performance, it's important to consider the trade-offs and \nfunctionality provided by different web frameworks and routers when making your selection.\n\n### Config\n```\nGOOS:   Linux\nGOARCH: amd64\nGO:     1.20\nCPU:    Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz\n```\n### Static Routes\nIt is just a collection of random static paths inspired by the structure of the Go directory. It might not be a realistic URL-structure.\n\n**GOMAXPROCS: 1**\n```\nBenchmarkHttpRouter_StaticAll     161659              7570 ns/op               0 B/op          0 allocs/op\nBenchmarkHttpTreeMux_StaticAll    132446              8836 ns/op               0 B/op          0 allocs/op\nBenchmarkFox_StaticAll            102577             11348 ns/op               0 B/op          0 allocs/op\nBenchmarkStdMux_StaticAll          91304             13382 ns/op               0 B/op          0 allocs/op\nBenchmarkGin_StaticAll             78224             15433 ns/op               0 B/op          0 allocs/op\nBenchmarkEcho_StaticAll            77923             15739 ns/op               0 B/op          0 allocs/op\nBenchmarkBeego_StaticAll           10000            101094 ns/op           55264 B/op        471 allocs/op\nBenchmarkGorillaMux_StaticAll       2283            525683 ns/op          113041 B/op       1099 allocs/op\nBenchmarkMartini_StaticAll          1330            936928 ns/op          129210 B/op       2031 allocs/op\nBenchmarkTraffic_StaticAll          1064           1140959 ns/op          753611 B/op      14601 allocs/op\nBenchmarkPat_StaticAll               967           1230424 ns/op          602832 B/op      12559 allocs/op\n```\nIn this benchmark, Fox performs as well as `Gin` and `Echo` which are both Radix Tree based routers. An interesting fact is\nthat [HttpTreeMux](https://github.com/dimfeld/httptreemux) also support [adding route while serving request concurrently](https://github.com/dimfeld/httptreemux#concurrency).\nHowever, it takes a slightly different approach, by using an optional `RWMutex` that may not scale as well as Fox under heavy load. The next\ntest compare `HttpTreeMux` with and without the `*SafeAddRouteFlag` (concurrent reads and writes) and `Fox` in parallel benchmark.\n\n**GOMAXPROCS: 16**\n```\nRoute: all\n\nBenchmarkFox_StaticAll-16                          99322             11369 ns/op               0 B/op          0 allocs/op\nBenchmarkFox_StaticAllParallel-16                 831354              1422 ns/op               0 B/op          0 allocs/op\nBenchmarkHttpTreeMux_StaticAll-16                 135560              8861 ns/op               0 B/op          0 allocs/op\nBenchmarkHttpTreeMux_StaticAllParallel-16*        172714              6916 ns/op               0 B/op          0 allocs/op\n```\nAs you can see, this benchmark highlight the cost of using higher synchronisation primitive like `RWMutex` to be able to register new route while handling requests.\n\n### Micro Benchmarks\nThe following benchmarks measure the cost of some very basic operations.\n\nIn the first benchmark, only a single route, containing a parameter, is loaded into the routers. Then a request for a URL \nmatching this pattern is made and the router has to call the respective registered handler function. End.\n\n**GOMAXPROCS: 1**\n```\nBenchmarkFox_Param              33024534                36.61 ns/op            0 B/op          0 allocs/op\nBenchmarkEcho_Param             31472508                38.71 ns/op            0 B/op          0 allocs/op\nBenchmarkGin_Param              25826832                52.88 ns/op            0 B/op          0 allocs/op\nBenchmarkHttpRouter_Param       21230490                60.83 ns/op           32 B/op          1 allocs/op\nBenchmarkHttpTreeMux_Param       3960292                280.4 ns/op          352 B/op          3 allocs/op\nBenchmarkBeego_Param             2247776                518.9 ns/op          352 B/op          3 allocs/op\nBenchmarkPat_Param               1603902                676.6 ns/op          512 B/op         10 allocs/op\nBenchmarkGorillaMux_Param        1000000                 1011 ns/op         1024 B/op          8 allocs/op\nBenchmarkTraffic_Param            648986                 1686 ns/op         1848 B/op         21 allocs/op\nBenchmarkMartini_Param            485839                 2446 ns/op         1096 B/op         12 allocs/op\n```\nSame as before, but now with multiple parameters, all in the same single route. The intention is to see how the routers scale with the number of parameters.\n\n**GOMAXPROCS: 1**\n```\nBenchmarkFox_Param5             16608495                72.84 ns/op            0 B/op          0 allocs/op\nBenchmarkGin_Param5             13098740                92.22 ns/op            0 B/op          0 allocs/op\nBenchmarkEcho_Param5            12025460                96.33 ns/op            0 B/op          0 allocs/op\nBenchmarkHttpRouter_Param5       8233530                148.1 ns/op          160 B/op          1 allocs/op\nBenchmarkHttpTreeMux_Param5      1986019                616.9 ns/op          576 B/op          6 allocs/op\nBenchmarkBeego_Param5            1836229                655.3 ns/op          352 B/op          3 allocs/op\nBenchmarkGorillaMux_Param5        757936                 1572 ns/op         1088 B/op          8 allocs/op\nBenchmarkPat_Param5               645847                 1724 ns/op          800 B/op         24 allocs/op\nBenchmarkTraffic_Param5           424431                 2729 ns/op         2200 B/op         27 allocs/op\nBenchmarkMartini_Param5           424806                 2772 ns/op         1256 B/op         13 allocs/op\n\n\nBenchmarkGin_Param20             4636416               244.6 ns/op             0 B/op          0 allocs/op\nBenchmarkFox_Param20             4667533               250.7 ns/op             0 B/op          0 allocs/op\nBenchmarkEcho_Param20            4352486               277.1 ns/op             0 B/op          0 allocs/op\nBenchmarkHttpRouter_Param20      2618958               455.2 ns/op           640 B/op          1 allocs/op\nBenchmarkBeego_Param20            847029                1688 ns/op           352 B/op          3 allocs/op\nBenchmarkHttpTreeMux_Param20      369500                2972 ns/op          3195 B/op         10 allocs/op\nBenchmarkGorillaMux_Param20       318134                3561 ns/op          3195 B/op         10 allocs/op\nBenchmarkMartini_Param20          223070                5117 ns/op          3619 B/op         15 allocs/op\nBenchmarkPat_Param20              157380                7442 ns/op          4094 B/op         73 allocs/op\nBenchmarkTraffic_Param20          119677                9864 ns/op          7847 B/op         47 allocs/op\n```\n\nNow let's see how expensive it is to access a parameter. The handler function reads the value (by the name of the parameter, e.g. with a map \nlookup; depends on the router) and writes it to `/dev/null`\n\n**GOMAXPROCS: 1**\n```\nBenchmarkFox_ParamWrite                 16707409                72.53 ns/op            0 B/op          0 allocs/op\nBenchmarkHttpRouter_ParamWrite          16478174                73.30 ns/op           32 B/op          1 allocs/op\nBenchmarkGin_ParamWrite                 15828385                75.73 ns/op            0 B/op          0 allocs/op\nBenchmarkEcho_ParamWrite                13187766                95.18 ns/op            8 B/op          1 allocs/op\nBenchmarkHttpTreeMux_ParamWrite          4132832               279.9 ns/op           352 B/op          3 allocs/op\nBenchmarkBeego_ParamWrite                2172572               554.3 ns/op           360 B/op          4 allocs/op\nBenchmarkPat_ParamWrite                  1200334               996.8 ns/op           936 B/op         14 allocs/op\nBenchmarkGorillaMux_ParamWrite           1000000              1005 ns/op            1024 B/op          8 allocs/op\nBenchmarkMartini_ParamWrite               454255              2667 ns/op            1168 B/op         16 allocs/op\nBenchmarkTraffic_ParamWrite               511766              2021 ns/op            2272 B/op         25 allocs/op\n```\n\nIn those micro benchmarks, we can see that `Fox` scale really well, even with long wildcard routes. Like `Gin`, this router reuse the\ndata structure (e.g. `fox.Context` slice) containing the matching parameters in order to remove completely heap allocation. \n\n### Github\nFinally, this benchmark execute a request for each GitHub API route (203 routes).\n\n**GOMAXPROCS: 1**\n```\nBenchmarkFox_GithubAll             63984             18555 ns/op               0 B/op          0 allocs/op\nBenchmarkEcho_GithubAll            49312             23353 ns/op               0 B/op          0 allocs/op\nBenchmarkGin_GithubAll             48422             24926 ns/op               0 B/op          0 allocs/op\nBenchmarkHttpRouter_GithubAll      45706             26818 ns/op           14240 B/op        171 allocs/op\nBenchmarkHttpTreeMux_GithubAll     14731             80133 ns/op           67648 B/op        691 allocs/op\nBenchmarkBeego_GithubAll            7692            137926 ns/op           72929 B/op        625 allocs/op\nBenchmarkTraffic_GithubAll           636           1916586 ns/op          845114 B/op      14634 allocs/op\nBenchmarkMartini_GithubAll           530           2205947 ns/op          238546 B/op       2813 allocs/op\nBenchmarkGorillaMux_GithubAll        529           2246380 ns/op          203844 B/op       1620 allocs/op\nBenchmarkPat_GithubAll               424           2899405 ns/op         1843501 B/op      29064 allocs/op\n```\n\n## Road to v1\n- [x] [Update route syntax](https://github.com/tigerwill90/fox/pull/10#issue-1643728309) @v0.6.0\n- [x] [Route overlapping](https://github.com/tigerwill90/fox/pull/9#issue-1642887919) @v0.7.0\n- [x] [Route overlapping (catch-all and params)](https://github.com/tigerwill90/fox/pull/24#issue-1784686061) @v0.10.0\n- [x] [Ignore trailing slash](https://github.com/tigerwill90/fox/pull/32), [Builtin Logger Middleware](https://github.com/tigerwill90/fox/pull/33), [Client IP Derivation](https://github.com/tigerwill90/fox/pull/33) @v0.14.0\n- [x] [Support infix wildcard](https://github.com/tigerwill90/fox/pull/46), [Support hostname routing](https://github.com/tigerwill90/fox/pull/48), [Support ACID transaction](https://github.com/tigerwill90/fox/pull/49) @v0.18.0\n- [x] [Support regexp params](https://github.com/tigerwill90/fox/pull/68) @v0.25.0\n- [x] [Support route matchers](https://github.com/tigerwill90/fox/pull/69), [Support SubRouter](https://github.com/tigerwill90/fox/pull/70), [Method-less tree](https://github.com/tigerwill90/fox/pull/71) @v0.26.0\n- [ ] Programmatic error handling\n- [ ] Improving performance and polishing\n- [ ] Stabilizing API\n\n## Contributions\nThis project aims to provide a lightweight, high-performance router that is easy to use and hard to misuse, designed for building API gateways and reverse proxies.\nFeatures are chosen carefully with an emphasis on composability, and each addition is evaluated against this core mission. The router exposes a relatively low-level API,\nallowing it to serve as a building block for implementing your own \"batteries included\" frameworks. Feature requests and PRs along these lines are welcome. \n\n## License\n\nFox is licensed under the **Apache License 2.0**. See [`LICENSE.txt`](./LICENSE.txt) for details.\n\nThe [**Fox logo**](https://github.com/tigerwill90/fox/blob/static/fox_logo.png) is licensed separately under [**CC BY-NC-ND 4.0**](https://creativecommons.org/licenses/by-nc-nd/4.0/?ref=chooser-v1). \nSee [`LICENSE-fox-logo.txt`](https://github.com/tigerwill90/fox/blob/static/LICENSE-fox-logo.txt) for details.\n\n## Acknowledgements\n- [hashicorp/go-immutable-radix](https://github.com/hashicorp/go-immutable-radix): Fox Tree design is inspired by Hashicorp's Immutable Radix Tree.\n- [julienschmidt/httprouter](https://github.com/julienschmidt/httprouter): some feature that implements Fox are inspired from Julien Schmidt's router. Most notably,\nthis package uses the optimized [httprouter.Cleanpath](https://github.com/julienschmidt/httprouter/blob/master/path.go) function.\n- [realclientip/realclientip-go](https://github.com/realclientip/realclientip-go): Fox uses a derivative version of Adam Pritchard's `realclientip-go` library. \nSee his insightful [blog post](https://adam-p.ca/blog/2022/03/x-forwarded-for/) on the topic for more details.\n- The router API is influenced by popular routers such as [Gin](https://github.com/gin-gonic/gin) and [Echo](https://github.com/labstack/echo).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftigerwill90%2Ffox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftigerwill90%2Ffox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftigerwill90%2Ffox/lists"}