Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
941 views
in Technique[技术] by (71.8m points)

amazon web services - How to create stun turn server instance using AWS EC2

Actually i wants to use my own stun/Turn server instance and i want to use Amazon EC2 .If anybody has any idea regarding this please share with me the steps to create or any reference link to follow.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

do an ssh login to your ec2 instance, then run the below commands for installing and starting the turn server.

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 

sample command for running TURN server:

turnserver -a -o -v -n -u user:root -p 3478 -L INT_IP -r someRealm -X EXT_IP/INT_IP  --no-dtls --no-tls

command description:

  • -X - your amazon instance's external IP, internal IP: EXT_IP/INT_IP
  • -p - port to be used, default 3478
  • -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

in your WebRTC app, you can use trun server like:

{
    url: 'turn:user@EXT_IP:3478',
    credential: 'root'
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...