在Ubuntu上为WebRTC安装Turn Server [英] Installing Turn Server On Ubuntu for WebRTC

查看:930
本文介绍了在Ubuntu上为WebRTC安装Turn Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在我的ubuntu 12.04上安装转服务器?你能分享教程吗?我读了这个为WebRTC应用程序实现我们自己的STUN / TURN服务器教程。但我不明白如何在我的ubuntu 12.04上安装转服务器?

How can i install turn server on my ubuntu 12.04? Can you share tutorial? i read this Implementing our own STUN/TURN server for WebRTC Application tutorial. But i didn't understand that how can i install turn server on my ubuntu 12.04?

var pc_config = {"iceServers": [{"url": "stun:stun.l.google.com:19302"},
  {"url":"turn:my_username@<turn_server_ip_address>", "credential":"my_password"}]};

pc_new = new webkitRTCPeerConnection(pc_config);

我想填写以上代码的参数来使用不同的网络。

And i want to fill above code's argumant to work with different network.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package resiprocate-turn-server

当我想安装转服务器然后我遇到了上述错误。我用apt-get install resiprocate-turn-server这个命令。并且使用了这个 https://www.webrtc-experiment。 com / docs / TURN-server-installation-guide.html 教程。

when i want to install turn server then i got above error. I used "apt-get install resiprocate-turn-server" this command. And ı used this https://www.webrtc-experiment.com/docs/TURN-server-installation-guide.html tutorial.

推荐答案

它很容易安装在linux机器上,而不是在其他操作系统中试过。

it is easy to install in linux machines, not tried in other OSes.

简单方法:

simple way:

sudo apt-get install coturn

如果你说不,我想要最新的前沿,你可以从他们的下载页面自行安装,例如:

If you say no, I want the latest cutting edge, you can download source code from their downloads page in install it yourself, example:

sudo -i     # ignore if you already in admin mode
apt-get update && apt-get install libssl-dev libevent-dev libhiredis-dev make -y    # install the dependencies
wget -O turn.tar.gz http://turnserver.open-sys.org/downloads/v4.5.0.3/turnserver-4.5.0.3.tar.gz     # Download the source tar
tar -zxvf turn.tar.gz     # unzip
cd turnserver-*
./configure
make && make install 

运行TURN服务器的示例命令:

sample command for running TURN server:

sudo turnserver -a -o -v -n  --no-dtls --no-tls -u test:test -r "someRealm"

命令说明:


  • -a - 使用长期凭证机制

  • -o - 将服务器进程作为守护程序运行

  • -v - '中等'详细模式。

  • -n - 没有配置文件

  • - no-dtls - 不要启动DTLS监听器

  • - no-tls - 不要启动TLS监听器

  • -u - 要使用的用户凭据

  • -r - 要使用的默认域,需要TURN REST API

  • -a - Use long-term credentials mechanism
  • -o - Run server process as daemon
  • -v - 'Moderate' verbose mode.
  • -n - no configuration file
  • --no-dtls - Do not start DTLS listeners
  • --no-tls - Do not start TLS listeners
  • -u - user credentials to be used
  • -r - default realm to be used, need for TURN REST API

检查这个 wiki 了解更多详情和配置。

check this wiki for more details and configurations.

现在您可以在WebRTC应用程序中使用TURN服务器:

now you can use the TURN server in your WebRTC application as:

var peerConnectionConfig = {
  iceServers: [{
    urls: YOUR_IP:3478,
    username: 'test',
    password: 'test'
  }]
}

这篇关于在Ubuntu上为WebRTC安装Turn Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆