{"id":13564667,"url":"https://github.com/plgd-dev/go-coap","last_synced_at":"2026-02-28T21:32:32.022Z","repository":{"id":36970217,"uuid":"135691938","full_name":"plgd-dev/go-coap","owner":"plgd-dev","description":"Implementation of CoAP Server \u0026 Client in Go","archived":false,"fork":false,"pushed_at":"2026-02-19T08:26:52.000Z","size":1505,"stargazers_count":501,"open_issues_count":50,"forks_count":127,"subscribers_count":15,"default_branch":"master","last_synced_at":"2026-02-19T13:51:15.021Z","etag":null,"topics":["blockwise-transfer","coap","coap-client","coap-noresponse","coap-protocol","coap-server","coap-tcp","dtls","iot","multicast","ocf","pion-dtls","udp"],"latest_commit_sha":null,"homepage":"https://coap.technology","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/plgd-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"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},"funding":{"open_collective":"go-coap"}},"created_at":"2018-06-01T08:43:15.000Z","updated_at":"2026-01-21T11:40:30.000Z","dependencies_parsed_at":"2023-09-27T18:11:52.991Z","dependency_job_id":"fb013e5e-19f4-40cd-b90d-a366b2549966","html_url":"https://github.com/plgd-dev/go-coap","commit_stats":null,"previous_names":["go-ocf/go-coap"],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/plgd-dev/go-coap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plgd-dev%2Fgo-coap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plgd-dev%2Fgo-coap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plgd-dev%2Fgo-coap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plgd-dev%2Fgo-coap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plgd-dev","download_url":"https://codeload.github.com/plgd-dev/go-coap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plgd-dev%2Fgo-coap/sbom","scorecard":{"id":432253,"data":{"date":"2025-08-11","repo":{"name":"github.com/plgd-dev/go-coap","commit":"f431046ea1ce2819c2c237ea8228d76330447368"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5,"checks":[{"name":"Maintained","score":1,"reason":"2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":5,"reason":"Found 11/21 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: found token with 'none' permissions: .github/workflows/cifuzz.yml:1","Warn: no topLevel permission defined: .github/workflows/golangci-lint.yml:1","Warn: no topLevel permission defined: .github/workflows/staticAnalysis.yml:1","Warn: no topLevel permission defined: .github/workflows/test-for-fork.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/cifuzz.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/cifuzz.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cifuzz.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/cifuzz.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cifuzz.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/cifuzz.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cifuzz.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/cifuzz.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/golangci-lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/golangci-lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/golangci-lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/staticAnalysis.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/staticAnalysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/staticAnalysis.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/staticAnalysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-for-fork.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/test-for-fork.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-for-fork.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/test-for-fork.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:76: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:81: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:93: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:99: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:115: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:122: update your workflow using https://app.stepsecurity.io/secureworkflow/plgd-dev/go-coap/test.yml/master?enable=pin","Warn: goCommand not pinned by hash: .github/workflows/staticAnalysis.yml:30","Info:   0 out of  15 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   5 third-party GitHubAction dependencies pinned","Info:   0 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":10,"reason":"project is fuzzed","details":["Info: OSSFuzz integration found","Info: GoBuiltInFuzzer integration found: message/codes/codes_test.go:87","Info: GoBuiltInFuzzer integration found: message/options_test.go:354","Info: GoBuiltInFuzzer integration found: tcp/coder/coder_test.go:65","Info: GoBuiltInFuzzer integration found: udp/coder/coder_test.go:198"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":3,"reason":"SAST tool is not run on all commits -- score normalized to 3","details":["Warn: 10 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T03:38:51.572Z","repository_id":36970217,"created_at":"2025-08-19T03:38:51.572Z","updated_at":"2025-08-19T03:38:51.572Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29952272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T18:42:55.706Z","status":"ssl_error","status_checked_at":"2026-02-28T18:42:48.811Z","response_time":90,"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":["blockwise-transfer","coap","coap-client","coap-noresponse","coap-protocol","coap-server","coap-tcp","dtls","iot","multicast","ocf","pion-dtls","udp"],"created_at":"2024-08-01T13:01:34.257Z","updated_at":"2026-02-28T21:32:32.000Z","avatar_url":"https://github.com/plgd-dev.png","language":"Go","funding_links":["https://opencollective.com/go-coap","https://opencollective.com/go-coap/sponsor/0/website?requireActive=false","https://opencollective.com/go-coap/backer/0/website?requireActive=false"],"categories":["Go","Libraries"],"sub_categories":["Go"],"readme":"# Go-CoAP\n\n[![Build Status](https://github.com/plgd-dev/go-coap/workflows/Test/badge.svg)](https://github.com/plgd-dev/go-coap/actions?query=workflow%3ATest)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=plgd-dev_go-coap\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=plgd-dev_go-coap)\n[![Coverage](https://img.shields.io/sonar/coverage/plgd-dev_go-coap?server=https%3A%2F%2Fsonarcloud.io)](https://sonarcloud.io/summary/overall?id=plgd-dev_go-coap)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fplgd-dev%2Fgo-coap.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fplgd-dev%2Fgo-coap?ref=badge_shield)\n[![sponsors](https://opencollective.com/go-coap/sponsors/badge.svg)](https://opencollective.com/go-coap#sponsors)\n[![contributors](https://img.shields.io/github/contributors/plgd-dev/go-coap)](https://github.com/plgd-dev/go-coap/graphs/contributors)\n[![GitHub stars](https://img.shields.io/github/stars/plgd-dev/go-coap)](https://github.com/plgd-dev/go-coap/stargazers)\n[![GitHub license](https://img.shields.io/github/license/plgd-dev/go-coap)](https://github.com/plgd-dev/go-coap/blob/master/LICENSE)\n[![GoDoc](https://pkg.go.dev/badge/github.com/plgd-dev/go-coap/v3?utm_source=godoc)](https://pkg.go.dev/github.com/plgd-dev/go-coap/v3?utm_source=godoc)\n\u003c!-- [![Go Report](https://goreportcard.com/badge/github.com/plgd-dev/go-coap)](https://goreportcard.com/report/github.com/plgd-dev/go-coap) --\u003e\n\nThe Constrained Application Protocol (CoAP) is a specialized web transfer protocol for use with constrained nodes and constrained networks in the Internet of Things.\nThe protocol is designed for machine-to-machine (M2M) applications such as smart energy and building automation.\n\nThe go-coap provides servers and clients for DTLS, TCP-TLS, UDP, TCP in golang language.\n\n## Features\n\n* CoAP over UDP [RFC 7252][coap].\n* CoAP over TCP/TLS [RFC 8232][coap-tcp]\n* Observe resources in CoAP [RFC 7641][coap-observe]\n* Block-wise transfers in CoAP [RFC 7959][coap-block-wise-transfers]\n* request multiplexer\n* multicast\n* CoAP NoResponse option in CoAP [RFC 7967][coap-noresponse]\n* CoAP over DTLS [pion/dtls][pion-dtls]\n* Too many requests response code [RFC 8516][coap-429]\n\n[coap]: http://tools.ietf.org/html/rfc7252\n[coap-tcp]: https://tools.ietf.org/html/rfc8323\n[coap-block-wise-transfers]: https://tools.ietf.org/html/rfc7959\n[coap-observe]: https://tools.ietf.org/html/rfc7641\n[coap-noresponse]: https://tools.ietf.org/html/rfc7967\n[pion-dtls]: https://github.com/pion/dtls\n[coap-429]: https://datatracker.ietf.org/doc/html/rfc8516\n\n## Requirements\n\n* Go 1.20 or higher\n\n## Samples\n\n### Simple\n\n#### Server UDP/TCP\n\n```go\n    // Server\n\n    // Middleware function, which will be called for each request.\n    func loggingMiddleware(next mux.Handler) mux.Handler {\n        return mux.HandlerFunc(func(w mux.ResponseWriter, r *mux.Message) {\n            log.Printf(\"ClientAddress %v, %v\\n\", w.Conn().RemoteAddr(), r.String())\n            next.ServeCOAP(w, r)\n        })\n    }\n\n    // See /examples/simple/server/main.go\n    func handleA(w mux.ResponseWriter, req *mux.Message) {\n        err := w.SetResponse(codes.GET, message.TextPlain, bytes.NewReader([]byte(\"hello world\")))\n        if err != nil {\n            log.Printf(\"cannot set response: %v\", err)\n        }\n    }\n\n    func main() {\n        r := mux.NewRouter()\n        r.Use(loggingMiddleware)\n        r.Handle(\"/a\", mux.HandlerFunc(handleA))\n        r.Handle(\"/b\", mux.HandlerFunc(handleB))\n\n        log.Fatal(coap.ListenAndServe(\"udp\", \":5688\", r))\n\n\n        // for tcp\n        // log.Fatal(coap.ListenAndServe(\"tcp\", \":5688\",  r))\n\n        // for tcp-tls\n        // log.Fatal(coap.ListenAndServeTLS(\"tcp\", \":5688\", \u0026tls.Config{...}, r))\n\n        // for udp-dtls\n        // log.Fatal(coap.ListenAndServeDTLS(\"udp\", \":5688\", \u0026dtls.Config{...}, r))\n    }\n```\n\n#### Client\n\n```go\n    // Client\n    // See /examples/simpler/client/main.go\n    func main() {\n        co, err := udp.Dial(\"localhost:5688\")\n\n        // for tcp\n        // co, err := tcp.Dial(\"localhost:5688\")\n\n        // for tcp-tls\n        // co, err := tcp.Dial(\"localhost:5688\", tcp.WithTLS(\u0026tls.Config{...}))\n\n        // for dtls\n        // co, err := dtls.Dial(\"localhost:5688\", \u0026dtls.Config{...}))\n\n        if err != nil {\n            log.Fatalf(\"Error dialing: %v\", err)\n        }\n        ctx, cancel := context.WithTimeout(context.Background(), time.Second)\n        defer cancel()\n        resp, err := co.Get(ctx, \"/a\")\n        if err != nil {\n            log.Fatalf(\"Cannot get response: %v\", err)\n            return\n        }\n        log.Printf(\"Response: %+v\", resp)\n    }\n```\n\n### Observe / Notify\n\n[Server](examples/observe/server/main.go) example.\n\n[Client](examples/observe/client/main.go) example.\n\n### Multicast\n\n[Server](examples/mcast/server/main.go) example.\n\n[Client](examples/mcast/client/main.go) example.\n\n## License\n\nApache 2.0\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fplgd-dev%2Fgo-coap.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fplgd-dev%2Fgo-coap?ref=badge_large)\n\n\u003c!-- markdownlint-disable MD033 --\u003e\n\n\u003ch2 align=\"center\"\u003eSponsors\u003c/h2\u003e\n\n[Become a sponsor](https://opencollective.com/go-coap#sponsor) and get your logo on our README on Github with a link to your site.\n\n\u003cdiv align=\"center\"\u003e\n\n\u003ca href=\"https://opencollective.com/go-coap/sponsor/0/website?requireActive=false\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/go-coap/sponsor/0/avatar.svg?requireActive=false\"\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n\u003ch2 align=\"center\"\u003eBackers\u003c/h2\u003e\n\n[Become a backer](https://opencollective.com/go-coap#backer) and get your image on our README on Github with a link to your site.\n\n\u003ca href=\"https://opencollective.com/go-coap/backer/0/website?requireActive=false\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/go-coap/backer/0/avatar.svg?requireActive=false\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplgd-dev%2Fgo-coap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplgd-dev%2Fgo-coap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplgd-dev%2Fgo-coap/lists"}