{"id":19725693,"url":"https://github.com/esl/mongooseice","last_synced_at":"2026-02-21T16:02:08.489Z","repository":{"id":57529251,"uuid":"79447473","full_name":"esl/MongooseICE","owner":"esl","description":"STUN/TURN server written in Elixir","archived":false,"fork":false,"pushed_at":"2019-09-02T08:45:47.000Z","size":263,"stargazers_count":118,"open_issues_count":7,"forks_count":15,"subscribers_count":58,"default_branch":"master","last_synced_at":"2025-07-07T00:35:53.504Z","etag":null,"topics":["elixir","ice","server","stun","turn"],"latest_commit_sha":null,"homepage":"https://www.erlang-solutions.com/products/mongooseim.html","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/esl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-01-19T11:36:50.000Z","updated_at":"2024-11-10T17:01:46.000Z","dependencies_parsed_at":"2022-08-26T03:32:54.607Z","dependency_job_id":null,"html_url":"https://github.com/esl/MongooseICE","commit_stats":null,"previous_names":["esl/fennec"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/esl/MongooseICE","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esl%2FMongooseICE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esl%2FMongooseICE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esl%2FMongooseICE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esl%2FMongooseICE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esl","download_url":"https://codeload.github.com/esl/MongooseICE/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esl%2FMongooseICE/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265453752,"owners_count":23768200,"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":["elixir","ice","server","stun","turn"],"created_at":"2024-11-11T23:32:37.346Z","updated_at":"2025-12-11T23:53:05.882Z","avatar_url":"https://github.com/esl.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MongooseICE\n\n[![Build Status][BUILD BADGE]][BUILD LINK]\n[![Coverage Status][COVERAGE BADGE]][COVERAGE LINK]\n\n[Documentation](https://hexdocs.pm/mongooseice/0.4.0)\n\nMongooseICE is a STUN server by [Erlang Solutions][OUR SITE] whose internals aim to be well written and tested.\n\n## Rationale\n\nMany modern applications (mobile and web) are media intensive like those involving audio, video, gaming, and file transfer.\nMongooseICE helps to get communication done peer-to-peer (without going through a server) so your **bandwidth and server-side costs don't need to be as much of a concern**.\n\n## Resources\n\nSome helpful technical material:\n\n* For the bigger picture see the **RTCPeerConnection plus servers** section under [this][OVERVIEW] tutorial\n* MongooseICE alone isn't enough to get peer-to-peer communication going.\nThe reason why is described in [this][SIGNALING] tutorial.\nOur [XMPP server][MONGOOSE], MongooseIM, is perfect for building a combination of signaling and chat applications\n* Find the STUN, TURN, and ICE RFCs (at the IETF site)\n\n### Installation as part of other application\n\nMongooseICE is available on [Hex](https://hex.pm/packages/mongooseice). To use it, just add it to your dependencies:\n\n```elixir\ndef deps do\n  [\n    {:mongooseice, \"~\u003e 0.4.0\"}\n  ]\nend\n```\n\n### Installation as standalone service\n\nFor now there are two ways of starting `MongooseICE` as standalone application. Via release built from\nsource or via prebuilt docker image. The docker image could be used for production system with a proper\nnetwork setup (the easiest one would be `--net=host` docker option). For developement on non-docker-native platforms\nit is probably easier to start the built release then setup docker container to work correctly.\nThis is due to the fact that TURN server uses system ephemeral port pool for allocations, which is\nnot so easy to map to the host machine. This issue is not visible on Linux systems, since you\ncan allow docker to use its private virtual network and just use the docker container's IP address\nas the relay IP (which is set this way in `MongooseICE` by default when using the docker image).\n\n#### Building and using a release\n\nYou may build the release and use it on production system. In order to do that, just type:\n\n```bash\nMIX_ENV=prod mix do deps.get, release\n```\n\nThe release can be configured by environment variables described in **Configuration** section below.\n\n#### Using docker prebuilt container\n\nYou can use our prebuilt docker images on our dockerhub:\n\n```bash\ndocker run -it -p 3478:3478/udp -e \"MONGOOSEICE_STUN_SECRET=very_secret\" mongooseim/mongooseice\n```\n\nThis command will start the *MongooseICE* server with default configuration and with STUN secret set\nto *very_secret*. If you are using this on Linux, the part with `-p 3478:3478/udp` is not needed, since\nyou can access the server directly using the container's IP. You can configure the server by passing\nenvironment variables to the container. All those variables are described in **Configuration** section below.\n\n#### Building docker container\n\nWell, that's gonna be quite simple and short:\n\n```bash\nMIX_ENV=prod mix do deps.get, docker.build, docker.release\n```\n\nAnd that's it. You have just built `MongooseICE's` docker image. The name of the image should be\nvisible at the end of the output of the command you've just run. You can configure the container by\nsetting environment variables that are described in **Configuration** section below.\n\n#### Configuration\n\nAssuming you are using release built with env `prod` or the docker image, you will have access to\nthe following system's environment viaribles:\n\n##### General configuration\n\n* `MONGOOSEICE_LOGLEVEL` - `debug`/`info`/`warn`/`error` - Log level of the application. `info` is the default one\n* `MONGOOSEICE_UDP_ENABLED` - `true`/`false` - Enable or disable UDP STUN/TURN interface. Enabled by default\n* `MONGOOSEICE_TCP_ENABLED` - `true`/`false` - *Not yet supported* - Enable or disable TCP STUN/TURN interface. Disabled by default.\n* `MONGOOSEICE_STUN_SECRET` - Secret that STUN/TURN clients have to use to authorize with the server\n\n##### UDP configuration\n\nThe following variables configure UDP STUN/TURN interface. It must be enabled via `MONGOOSEICE_UDP_ENABLED=true` in order for those options to take effect.\n\n* `MONGOOSEICE_UDP_BIND_IP` - IP address on which MongooseICE listens for requests. Release default is `127.0.0.1`, but in case of docker container the default is `0.0.0.0`\n* `MONGOOSEICE_UDP_PORT` - Port which server listens on for STUN/TURN requests. Default is `3478`\n* `MONGOOSEICE_UDP_REALM` - Realm name for this MongooseICE server as defined in [TURN RFC](https://tools.ietf.org/rfc/rfc5766.txt). Default: `udp.localhost.local`\n* `MONGOOSEICE_UDP_RELAY_IP` - IP of the relay interface. All `allocate` requests will return this IP address to the client, therefore this cannot be set to `0.0.0.0`. Release default is `127.0.0.1`, but in case of docker container the default is set to the first IP address returned by `hostname -i` on the container.\n\n##### TCP configuration\n\nTCP is not yet supported.\n\n### Checklist of STUN/TURN methods supported by MongooseICE\n\n- [x] Binding\n- [x] Allocate\n- [x] Refresh\n- [x] Send\n- [x] Data\n- [x] CreatePermission\n- [x] ChannelBind\n\n### Checklist of STUN/TURN attributes supported by MongooseICE\n\n#### Comprehension Required\n\n- [x] XOR-MAPPED-ADDRESS\n- [x] MESSAGE-INTEGRITY\n- [x] ERROR-CODE\n- [x] UNKNOWN-ATTRIBUTES\n- [x] REALM\n- [x] NONCE\n- [x] CHANNEL-NUMBER\n- [x] LIFETIME\n- [x] XOR-PEER-ADDRESS\n- [x] DATA\n- [x] XOR-RELAYED-ADDRESS\n- [x] EVEN-PORT\n- [x] REQUESTED-TRANSPORT\n- [ ] DONT-FRAGMENT\n- [x] RESERVATION-TOKEN\n- [ ] PRIORITY\n- [ ] USE-CANDIDATE\n- [ ] ICE-CONTROLLED\n- [ ] ICE-CONTROLLING\n\n#### Comprehension Optional\n\n- [ ] SOFTWARE\n- [ ] ALTERNATE-SERVER\n- [ ] FINGERPRINT\n\n## License\n\nCopyright 2017 Erlang Solutions Ltd.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n[BUILD BADGE]: https://travis-ci.org/esl/MongooseICE.svg?branch=master\n[BUILD LINK]: https://travis-ci.org/esl/MongooseICE\n\n[COVERAGE BADGE]: https://coveralls.io/repos/github/esl/MongooseICE/badge.svg\n[COVERAGE LINK]: https://coveralls.io/github/esl/MongooseICE\n\n[OUR SITE]: https://www.erlang-solutions.com/\n\n[OVERVIEW]: https://www.html5rocks.com/en/tutorials/webrtc/basics/#toc-rtcpeerconnection\n[SIGNALING]: https://www.html5rocks.com/en/tutorials/webrtc/basics/#toc-rtcpeerconnection\n\n[MONGOOSE]: https://github.com/esl/MongooseIM\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesl%2Fmongooseice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesl%2Fmongooseice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesl%2Fmongooseice/lists"}