{"id":36484636,"url":"https://github.com/bugfan/srv","last_synced_at":"2026-01-12T01:43:52.629Z","repository":{"id":57632132,"uuid":"228344840","full_name":"bugfan/srv","owner":"bugfan","description":null,"archived":false,"fork":false,"pushed_at":"2022-03-11T02:34:58.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T17:29:41.644Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bugfan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-16T09:01:36.000Z","updated_at":"2022-03-11T02:35:01.000Z","dependencies_parsed_at":"2022-08-31T13:02:27.975Z","dependency_job_id":null,"html_url":"https://github.com/bugfan/srv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bugfan/srv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfan%2Fsrv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfan%2Fsrv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfan%2Fsrv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfan%2Fsrv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bugfan","download_url":"https://codeload.github.com/bugfan/srv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfan%2Fsrv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"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":[],"created_at":"2026-01-12T01:43:49.919Z","updated_at":"2026-01-12T01:43:52.624Z","avatar_url":"https://github.com/bugfan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Golang http handler\n\n## Installation\n```\ngo get -u github.com/bugfan/srv\n```\n\n## Usage\n[Refer to this test file](https://github.com/bugfan/srv/blob/master/srv_test.go \"test file\")\n\n```\naddr := \":8080\"\ns := srv.New(\"addr\")\n\n// set head middleware\ns.AddHeadHandler(\u0026zlog{}, \u0026auth{})\n\n// set tail middleware\ns.AddTailHandler(\u0026zlog{})\n\n// set your handler\ns.Handle(\"/\", \u0026yourHandler{})\ns.Handle(\"/ws/\", \u0026yourWebsocketHandler{})\ns.Handle(\"/static/\", \u0026yourStaticHandler{})\n\n/*\n* if hava tls certificate data\n*/\n// keyData := []byte(\"xxxx\")\n// certData := []byte(\"xxxx\")\n// s.SetTLSConfigFromBytes(certData, keyData)\n\n/*\n* if hava tls config\n*/\n// tlsconfig := \u0026tls.Config{}\n// s.SetTLSConfig(tlsconfig)\n\n// listen s\n/*\n* method 1\n* run directly\n*/\n\ns.Run()\n\n/*\n* method 2\n* if you have own listener\n*/\n// http.ListenAndServe(addr, s)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugfan%2Fsrv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugfan%2Fsrv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugfan%2Fsrv/lists"}