{"id":28349739,"url":"https://github.com/mkch/burrow","last_synced_at":"2025-06-11T14:02:11.012Z","repository":{"id":11029322,"uuid":"13361169","full_name":"mkch/burrow","owner":"mkch","description":"Toolkit for go net/http.","archived":false,"fork":false,"pushed_at":"2021-12-14T12:14:44.000Z","size":87,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T01:56:51.972Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-06T11:33:52.000Z","updated_at":"2021-12-14T12:14:47.000Z","dependencies_parsed_at":"2022-09-26T18:01:46.896Z","dependency_job_id":null,"html_url":"https://github.com/mkch/burrow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkch%2Fburrow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkch%2Fburrow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkch%2Fburrow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkch%2Fburrow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkch","download_url":"https://codeload.github.com/mkch/burrow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkch%2Fburrow/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259279239,"owners_count":22833408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-05-27T20:11:00.268Z","updated_at":"2025-06-11T14:02:11.004Z","avatar_url":"https://github.com/mkch.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Burrow for gophers.\n======\nToolkit for go net/http.\n\n## Install\n\tgo get github.com/mkch/burrow\n\tgo install github.com/mkch/burrow\n## Examples\n### * Compress\n\tpackage compress_test\n\t\n\timport (\n\t    \"github.com/mkch/burrow/compress\"\n\t    \"net/http\"\n\t)\n\t\n\tfunc main() {\n\t    http.ListenAndServe(\":8080\", compress.NewHandler(http.DefaultServeMux, nil))\n\t}\n### * Session\n\tpackage session_test\n\t\n\timport (\n\t\t\"github.com/mkch/burrow/session\"\n\t\t\"net/http\"\n\t)\n\t\n\tvar sessionManager = session.NewSessionManager()\n\t\n\tfunc main() {\n\t\thttp.Handle(\"/foo\", session.HTTPHandlerFunc(fooHandler))\n\t\thttp.ListenAndServe(\":8080\", sessionManager.Handler(http.DefaultServeMux))\n\t}\n\t\n\tfunc fooHandler(w http.ResponseWriter, r *http.Request, s session.Session) {\n\t\t// Access session value with s.\n\t}\n### * Status Hook\n\tpackage statushook_test\n\t\n\timport (\n\t\t\"github.com/mkch/burrow/statushook\"\n\t\t\"net/http\"\n\t)\n\t\n\tfunc main() {\n\t\thttp.HandleFunc(\"/foo\",\n\t\t\tfunc(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tw.Write([]byte(\"This is foo.\"))\n\t\t\t})\n\t\n\t\trefined404Hook := func(code int, w http.ResponseWriter, r *http.Request) {\n\t\t\tif code == http.StatusNotFound {\n\t\t\t\tw.Write([]byte(\"404 Gohper is not here: \"+r.URL.String()))\n\t\t\t}\n\t\t}\n\t\thandler := statushook.Handler(http.DefaultServeMux, statushook.HookFunc(refined404Hook))\n\t\thttp.ListenAndServe(\"localhost:8181\", handler)\n\t\n\t\t// Please access http://localhost:8181/anything-except-foo in your browser\n\t\t// to get the refined 404 page:\n\t\t//\n\t\t//\t\t404 Gohper is not here: /anything-except-foo\n\t}\n### * Google SPDY™\n\tpackage spdy_test\n\t\n\timport (\n\t\t\"crypto/tls\"\n\t\t\"github.com/mkch/burrow/spdy\"\n\t\t\"net/http\"\n\t)\n\t\n\tfunc main() {\n\t\tserver := \u0026http.Server{\n\t\t\tAddr: \":8080\",\n\t\t\tTLSConfig: \u0026tls.Config{\n\t\t\t\tNextProtos: []string{\"spdy/2\"},\n\t\t\t},\n\t\t\tTLSNextProto: map[string]func(*http.Server, *tls.Conn, http.Handler){\n\t\t\t\t\"spdy/2\": spdy.TLSNextProtoFuncV2,\n\t\t\t},\n\t\t}\n\t\n\t\thttp.HandleFunc(\"/hello\", func(w http.ResponseWriter, req *http.Request) {\n\t\t\tw.Write([]byte(\"Hello, \" + req.URL.String()))\n\t\t\tif spdy.Spdy(req) {\n\t\t\t\tw.Write([]byte(\" from SPDY!\"))\n\t\t\t}\n\t\t})\n\t\n\t\tserver.ListenAndServeTLS(\"/path/to/host.crt\", \"/path/to/host.key\")\n\t}","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkch%2Fburrow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkch%2Fburrow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkch%2Fburrow/lists"}