{"id":13563040,"url":"https://github.com/pion/turn","last_synced_at":"2026-05-15T07:09:15.253Z","repository":{"id":37249580,"uuid":"130457263","full_name":"pion/turn","owner":"pion","description":"Pion TURN, an API for building TURN clients and servers","archived":false,"fork":false,"pushed_at":"2025-05-01T15:31:42.000Z","size":2331,"stargazers_count":2005,"open_issues_count":36,"forks_count":341,"subscribers_count":46,"default_branch":"master","last_synced_at":"2025-05-07T21:12:03.178Z","etag":null,"topics":["go","golang","nat","pion","stun","traversal","turn","turn-client","turn-server","turn-servers","webrtc"],"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/pion.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-04-21T09:03:15.000Z","updated_at":"2025-05-06T06:49:24.000Z","dependencies_parsed_at":"2022-07-12T16:14:49.459Z","dependency_job_id":"74ff64ec-bc58-4fbe-bbe5-78a9644ef4fe","html_url":"https://github.com/pion/turn","commit_stats":{"total_commits":403,"total_committers":47,"mean_commits":8.574468085106384,"dds":0.8411910669975187,"last_synced_commit":"933fb10c84fbed9964cc000eaeb88a66d8274588"},"previous_names":["pions/turn"],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pion%2Fturn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pion%2Fturn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pion%2Fturn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pion%2Fturn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pion","download_url":"https://codeload.github.com/pion/turn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235685,"owners_count":22036962,"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":["go","golang","nat","pion","stun","traversal","turn","turn-client","turn-server","turn-servers","webrtc"],"created_at":"2024-08-01T13:01:14.563Z","updated_at":"2026-05-15T07:09:10.217Z","avatar_url":"https://github.com/pion.png","language":"Go","funding_links":[],"categories":["Go","webrtc","Stun \u0026 Turn","Interconnect"],"sub_categories":["C/C++","SBC, IMS"],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://pion.ly\"\u003e\u003cimg src=\"./.github/gopher-pion.png\" alt=\"Pion TURN\" height=\"250px\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  Pion TURN\n  \u003cbr\u003e\n\u003c/h1\u003e\n\u003ch4 align=\"center\"\u003eA toolkit for building TURN clients and servers in Go\u003c/h4\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pion.ly\"\u003e\u003cimg src=\"https://img.shields.io/badge/pion-turn-gray.svg?longCache=true\u0026colorB=brightgreen\" alt=\"Pion TURN\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://discord.gg/PngbdqpFbt\"\u003e\u003cimg src=\"https://img.shields.io/badge/join-us%20on%20discord-gray.svg?longCache=true\u0026logo=discord\u0026colorB=brightblue\" alt=\"join us on Discord\"\u003e\u003c/a\u003e \u003ca href=\"https://bsky.app/profile/pion.ly\"\u003e\u003cimg src=\"https://img.shields.io/badge/follow-us%20on%20bluesky-gray.svg?longCache=true\u0026logo=bluesky\u0026colorB=brightblue\" alt=\"Follow us on Bluesky\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/pion/awesome-pion\" alt=\"Awesome Pion\"\u003e\u003cimg src=\"https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  \u003cimg alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/pion/turn/test.yaml\"\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/pion/turn/v4\"\u003e\u003cimg src=\"https://pkg.go.dev/badge/github.com/pion/turn/v4.svg\" alt=\"Go Reference\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/pion/turn\"\u003e\u003cimg src=\"https://codecov.io/gh/pion/turn/branch/master/graph/badge.svg\" alt=\"Coverage Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/pion/turn/v4\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/pion/turn/v4\" alt=\"Go Report Card\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"License: MIT\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\nPion TURN is a Go toolkit for building TURN servers and clients. We wrote it to solve problems we had when building RTC projects.\n\n* **Deployable** - Use modern tooling of the Go ecosystem. Stop generating config files.\n* **Embeddable** - Include `pion/turn` in your existing applications. No need to manage another service.\n* **Extendable** - TURN as an API so you can easily integrate with your existing monitoring and metrics.\n* **Maintainable** - `pion/turn` is simple and well documented. Designed for learning and easy debugging.\n* **Portable** - Quickly deploy to multiple architectures/platforms just by setting an environment variable.\n* **Safe** - Stability and safety is important for network services. Go provides everything we need.\n* **Scalable** - Create allocations and mutate state at runtime. Designed to make scaling easy.\n\n### Using\n`pion/turn` is an API for building STUN/TURN clients and servers, not a binary you deploy then configure. It may require copying our examples and\nmaking minor modifications to fit your need, no knowledge of Go is required however. You may be able to download the pre-made binaries of our examples\nif you wish to get started quickly.\n\nThe advantage of this is that you don't need to deal with complicated config files, or custom APIs to modify the state of Pion TURN.\nAfter you instantiate an instance of a Pion TURN server or client you interact with it like any library. The quickest way to get started is to look at the\n[examples](examples) or [GoDoc](https://godoc.org/github.com/pion/turn)\n\n### Examples\nWe try to cover most common use cases in [examples](examples). If more examples could be helpful please file an issue, we are always looking\nto expand and improve `pion/turn` to make it easier for developers.\n\nTo build any example you just need to run `go build` in the directory of the example you care about.\nIt is also very easy to [cross compile](https://dave.cheney.net/2015/08/22/cross-compilation-with-go-1-5) Go programs.\n\nYou can also see `pion/turn` usage in [pion/ice](https://github.com/pion/ice)\n\n### FAQ\n\nAlso take a look at the [Pion WebRTC FAQ](https://github.com/pion/webrtc/wiki/FAQ)\n\n#### Will pion/turn also act as a STUN server?\nYes.\n\n#### How do I implement token-based authentication?\nReplace the username with a token in the [AuthHandler](https://github.com/pion/turn/blob/6d0ff435910870eb9024b18321b93b61844fcfec/examples/turn-server/simple/main.go#L49).\nThe password sent by the client can be any non-empty string, as long as it matches that used by the [GenerateAuthKey](https://github.com/pion/turn/blob/6d0ff435910870eb9024b18321b93b61844fcfec/examples/turn-server/simple/main.go#L41)\nfunction.\n\n#### Will WebRTC prioritize using STUN over TURN?\nYes.\n\n### RFCs\n#### Implemented\n* **RFC 5389**: [Session Traversal Utilities for NAT (STUN)][rfc5389]\n* **RFC 5766**: [Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)][rfc5766]\n\n#### Planned\n* **RFC 6062**: [Traversal Using Relays around NAT (TURN) Extensions for TCP Allocations][rfc6062]\n* **RFC 6156**: [Traversal Using Relays around NAT (TURN) Extension for IPv6][rfc6156]\n\n[rfc5389]: https://tools.ietf.org/html/rfc5389\n[rfc5766]: https://tools.ietf.org/html/rfc5766\n[rfc6062]: https://tools.ietf.org/html/rfc6062\n[rfc6156]: https://tools.ietf.org/html/rfc6156\n\n### Roadmap\nThe library is used as a part of our WebRTC implementation. Please refer to that [roadmap](https://github.com/pion/webrtc/issues/9) to track our major milestones.\n\n### Community\nPion has an active community on the [Discord](https://discord.gg/PngbdqpFbt).\n\nFollow the [Pion Bluesky](https://bsky.app/profile/pion.ly) or [Pion Twitter](https://twitter.com/_pion) for project updates and important WebRTC news.\n\nWe are always looking to support **your projects**. Please reach out if you have something to build!\nIf you need commercial support or don't want to use public methods you can contact us at [team@pion.ly](mailto:team@pion.ly)\n\n### Contributing\nCheck out the [contributing wiki](https://github.com/pion/webrtc/wiki/Contributing) to join the group of amazing people making this project possible\n\n### License\nMIT License - see [LICENSE](LICENSE) for full text\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpion%2Fturn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpion%2Fturn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpion%2Fturn/lists"}