TURN and STUN 服务器

tyranron f41aee2224 Fix tagging released Docker image on CI 3 years ago
.github f41aee2224 Fix tagging released Docker image on CI 3 years ago
cmake 40c99db6ba Support Windows MSVC (#855) 3 years ago
docker 7feae7afe4 Fix tests for `linux/386` Docker image platform 3 years ago
examples ab1292059f Update turnserver.conf (#1009) 3 years ago
fuzzing d9108a4b54 Add clang format rules and checks (#935) 3 years ago
man bf54410bc7 Merge branch 'sysvinit/toggle-username-labels-upstream' of github.com:wireapp/coturn into wireapp-sysvinit/toggle-username-labels-upstream 3 years ago
rpm 27e5dd6e23 Change rpm systemd service type from notify to exec (#1043) 3 years ago
src 95373d3e2a Cleanup logs on turnserver start (#1088) 3 years ago
turndb a767115055 Add hash algorithm for key value to redis userdb schema 4 years ago
.dockerignore 8b8660530e Avoid duplication via common rootfs/ dir 4 years ago
.gitignore 40c99db6ba Support Windows MSVC (#855) 3 years ago
.travis.yml d8026372af Remove trusty add focal 4 years ago
AUTHORS d550dd200c replace email address 7 years ago
CMakeLists.txt e55bbc0413 Optional build info compiled into turnserver binary (#1083) 3 years ago
ChangeLog 73c14d6b10 Replace references to non-existent pdf file with links (#1002) 3 years ago
INSTALL bd46483efa Modify INSTALL 4 years ago
LICENSE 702b29bc22 initial code import 11 years ago
LICENSE.OpenSSL 702b29bc22 initial code import 11 years ago
Makefile.in d9108a4b54 Add clang format rules and checks (#935) 3 years ago
NOTE e2c5911fe4 working on 4.4.5.4 10 years ago
README.md 945f290c03 [README.md] Reflect new native Windows build support in documentation (#1060) 3 years ago
README.turnadmin 08bb62ea88 Update README to fix #658 4 years ago
README.turnserver 4bab2adba4 Use a single SSL context object (#989) 3 years ago
README.turnutils 08bb62ea88 Update README to fix #658 4 years ago
STATUS dbc9dee42b working on multi-tenant server based upon oauth 10 years ago
TODO 670b6b6617 TODO updated 10 years ago
configure 1467a5bd14 Better detect SCTP protocol (#1016) 3 years ago
make-man.sh 2ff0150c98 man pages util fixed 8 years ago
netarch.txt 6618ea3c9a fix typo in netarch.txt 7 years ago
postinstall.txt f53058abc6 fix(doc): Updated copy on postinstall.txt 7 years ago
vcpkg.json 40c99db6ba Support Windows MSVC (#855) 3 years ago

README.md

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.

Downloads page

Docker image

Wiki pages

Free open source implementation of TURN and STUN Server

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.

On-line management interface (over telnet or over HTTPS) for the TURN server is available.

The implementation also includes some extra experimental features.

Supported RFCs:

TURN specs:

STUN specs:

  • RFC 3489 - "classic" STUN
  • RFC 5389 - base "new" STUN specs
  • RFC 5769 - test vectors for STUN protocol testing
  • RFC 5780 - NAT behavior discovery support
  • RFC 7443 - ALPN support for STUN & TURN
  • RFC 7635 - oAuth third-party TURN/STUN authorization

Supported ICE and related specs:

  • RFC 5245 - ICE
  • RFC 5768 – ICE–SIP
  • RFC 6336 – ICE–IANA Registry
  • RFC 6544 – ICE–TCP
  • RFC 5928 - TURN Resolution Mechanism

The implementation fully supports the following client-to-TURN-server protocols:

Supported relay protocols:

  • UDP (per RFC 5766)
  • TCP (per RFC 6062)

Supported user databases (for user repository, with passwords or keys, if authentication is required):

  • SQLite
  • MySQL
  • PostgreSQL
  • Redis
  • MongoDB

Redis can also be used for status and statistics storage and notification.

By default a prometheus exporter endpoint is disabled, if it is enabled it will listen on port 9641 under path /metrics

Supported message integrity digest algorithms:

  • HMAC-SHA1, with MD5-hashed keys (as required by STUN and TURN standards)

Supported 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);
  • experimental third-party oAuth-based client authorization option;

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;
  • built-in 300 ALTERNATE-SERVER mechanism (requires 300 response support by the TURN client);
  • network load-balancer server.

Traffic bandwidth limitation and congestion avoidance algorithms implemented.

The supported project target platforms are:

  • Linux (Debian, Ubuntu, Mint, CentOS, Fedora, Redhat, Amazon Linux, Arch Linux, OpenSUSE)
  • BSD (FreeBSD, NetBSD, OpenBSD, DragonFlyBSD)
  • Solaris 11
  • Mac OS X
  • 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.

To achieve high performance and scalability, the TURN server is implemented with the following features:

  • High-performance industrial-strength Network IO engine libevent2 is used
  • Configurable multi-threading model implemented to allow full usage of available CPU resources (if OS allows multi-threading)
  • Multiple listening and relay addresses can be configured
  • Efficient memory model used
  • 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".

Contact information:

https://groups.google.com/forum/#!forum/turn-server-project-rfc5766-turn-server

email:[email protected]

  [email protected]

Feedback is very welcome (bugs, issues, suggestions, stories, questions).

Volunteers are welcome, too.