**_This project evolved from rfc5766-turn-server project (https://code.google.com/p/rfc5766-turn-server/). There are many new advanced TURN specs which are going far beyond the original RFC 5766 document. This project takes the code of rfc5766-turn-server as the starter, and adds new advanced features to it._**
coturn is a free open source implementation of TURN and STUN Server.
The TURN Server is a VoIP media traffic NAT traversal server and gateway.
# Free open source implementation of TURN and STUN Server #
## Installing / Getting started
The TURN Server is a VoIP media traffic NAT traversal server and gateway. It can be used as a general-purpose network traffic TURN server and gateway, too.
Linux distros may have a version of coturn which you can install by
```
apt install coturn
turnserver --log-file stdout
```
On-line management interface (over telnet or over HTTPS) for the TURN server is available.
* TCP (per [RFC 5766](https://datatracker.ietf.org/doc/html/rfc5766) and [RFC 6062](https://datatracker.ietf.org/doc/html/rfc6062))
* TLS (per [RFC 5766](https://datatracker.ietf.org/doc/html/rfc) and [RFC 6062](https://datatracker.ietf.org/doc/html/rfc6062)): including TLS1.3; ECDHE is supported.
* DTLS1.0 and DTLS1.2 (http://tools.ietf.org/html/draft-petithuguenin-tram-turn-dtls-00)
Supported user databases (for user repository, with passwords or keys, if authentication is required):
User databases (for user repository, with passwords or keys, if authentication is required):
* SQLite
* MySQL
* PostgreSQL
* Redis
* MongoDB
Management interfaces:
* telnet cli
* HTTPS interface
Redis can also be used for status and statistics storage and notification.
By default a [prometheus](https://prometheus.io/) exporter endpoint is disabled, if it is enabled it will listen on port 9641 under path /metrics
Monitoring:
* Redis can be used for status and statistics storage and notification
* [prometheus](https://prometheus.io/) interface
Supported message integrity digest algorithms:
Message integrity digest algorithms:
* HMAC-SHA1, with MD5-hashed keys (as required by STUN and TURN standards)
Supported TURN authentication mechanisms:
TURN authentication mechanisms:
* 'classic' long-term credentials mechanism;
* TURN REST API (a modification of the long-term mechanism, for time-limited secret-based authentication, for WebRTC applications: http://tools.ietf.org/html/draft-uberti-behave-turn-rest-00);
When used as a part of an ICE solution, for VoIP connectivity, this TURN server can handle thousands simultaneous calls per CPU (when TURN protocol is used) or tens of thousands calls when only STUN protocol is used. For virtually unlimited scalability a load balancing scheme can be used. The load balancing can be implemented with the following tools (either one or a combination of them):
* DNS SRV based load balancing;
@ -90,7 +133,7 @@ When used as a part of an ICE solution, for VoIP connectivity, this TURN server
Traffic bandwidth limitation and congestion avoidance algorithms implemented.
@ -99,10 +142,6 @@ The supported project target platforms are:
* Cygwin (for non-production R&D purposes)
* Windows (native with, e.g., MSVC toolchain)
Other server platforms can be supported by request.
Any client platform is supported, including Android, iOS, Linux, OS X, Windows, and Windows Phone.
This project can be successfully used on other `*NIX` platforms, too, but that is not officially supported.
The implementation is supposed to be simple, easy to install and configure. The project focuses on performance, scalability and simplicity. The aim is to provide an enterprise-grade TURN solution.
@ -116,15 +155,10 @@ To achieve high performance and scalability, the TURN server is implemented with
* The TURN project code can be used in a custom proprietary networking environment. In the TURN server code, an abstract networking API is used. Only couple files in the project have to be re-written to plug-in the TURN server into a proprietary environment. With this project, only implementation for standard UNIX Networking/IO API is provided, but the user can implement any other environment. The TURN server code was originally developed for a high-performance proprietary corporate environment, then adopted for UNIX Networking API
* The TURN server works as a user space process, without imposing any special requirements on the system
To download the TURN Server software, the client messaging library and the test programs, click the tab "Downloads".