ข้ามไปที่เนื้อหาหลัก

การติดตั้งและปรับแต่ง TURN Server ด้วย Coturn เพื่อให้บริการ Live Streaming

 บนนำ


WebRTC ใช้สำหรับการโอนย้ายข้อมูลแบบ peer-to-peer 


Coturn เป็นโอเพนซอร์สฟรี สำหับการนำไปใช้งานกับ STUN และTURN  

ความต้องการของระบบ


สำหรับการติดตั้ง 

1. ทำการอัฟเดล 

sudo apt-get update -y

2. ติดตั้อง Conturn

sudo apt-get install coturn

3. แก้ไขไฟล์ conturn

sudo nano /etc/default/coturn
TURNSERVER_ENABLED=1 

4. รันคำสั่ง

systemctl start coturn


การปรับแต่งค่าคอนฟิกูเรชั่น

1. ทำการแบ๊คอัพไฟล์ 

mv /etc/turnserver.conf /etc/turnserver.conf.backup

เมื่อเกิดความผิดพลาด  

mv /etc/turnserver.conf.backup /etc/turnserver.conf

เปิดไฟล์

nano /etc/turnserver.conf



แก้ไขไฟล์

# TURN server name and realm
realm=<DOMAIN>
server-name=<SERVER_NAME>

เปลี่ยน ip ภายนอก 

# IPs the TURN server listens to
listening-ip=0.0.0.0

# External IP-Address of the TURN server
external-ip=IP_ADDRESS


ปรับพอร์ต

# Main listening port
listening-port=3478

# Further ports that are open for communication
min-port=10000
max-port=20000

กำหนดเส้นทางเก็บไฟล์ log

# Use fingerprint in TURN message
fingerprint

# Log file path
log-file=/var/log/turnserver.log

# Enable verbose logging
verbose

กำหนดการยืนยันตัวตนสำหรับเข้า Server ให้สิทธิ์ผู้ใช้

# Specify the user for the TURN authentification
user=user:password

# Enable long-term credential mechanism
lt-cred-mech

ไฟล์ฉบันเต็ม

# TURN server name and realm
realm=DOMAIN
server-name=turnserver

# Use fingerprint in TURN message
fingerprint

# IPs the TURN server listens to
listening-ip=0.0.0.0

# External IP-Address of the TURN server
external-ip=IP_ADDRESS

# Main listening port
listening-port=3478

# Further ports that are open for communication
min-port=10000
max-port=20000

# Log file path
log-file=/var/log/turnserver.log

# Enable verbose logging
verbose

# Specify the user for the TURN authentification
user=user:password

# Enable long-term credential mechanism
lt-cred-mech

# If running coturn version older than 4.5.2, uncomment these rules and ensure
# that you have listening-ip set to ipv4 addresses only.
# Prevent Loopback bypass https://github.com/coturn/coturn/security/advisories/GHSA-6g6j-r9rf-cm7p
#denied-peer-ip=0.0.0.0-0.255.255.255
#denied-peer-ip=127.0.0.0-127.255.255.255
#denied-peer-ip=::1

ทำการเปิด service

sudo service coturn restart


ทดสอบ TURN Server



//// 




ความคิดเห็น

โพสต์ยอดนิยมจากบล็อกนี้

SaaS API-Base Definition, Benefits, Challenges, Problems and Goal for Innovation

What is an Application Programming Interface? API is a set of protocols, standards, and tools that allow two or more software applications to connect and share specific data. API  What is API-Base Saas? API-based SaaS is a software application hosted in the cloud. Users and other programs can access the software’s features, data, and functions via an API instead of a user interface. API refers to the software delivery model as a SaaS Application's functionalist and features are exposed and made to customers through APIs. This combination of the business model of technology on a cloud-base.   This is an integration Service on the cloud provider The Benefits of API-Base SaaS User Experience  Simplifies Development  Increases Accessibility Flexible and Scalable  The Challenges of API-Base SaaS Startup Performance  Integration  Security Pricing What’s The Difference Between SaaS And An API? RPC APIs.  WebSocket APIs. SOAP APIs. REST APIs. The Too...

Interactive เทคโนโลยีเชิงโต้ตอบเปลี่ยนโลกเข้าสู่ยุค Metaverse

เทคโนโลยี Interactive คืออะไร คำนิยามของ เทคโนโลยี Interactive ที่สร้างและพัฒนาขึ้นสำหรับโปรแกรมหรือแอพลิเคชั่นที่เป็น Real-Time เรียกง่ายๆว่า Real-Time Programming (RTP) โดยเน้นไปยังผู้ใช้หรือมนุษย์นั้นเอง จะประกอบไปด้วย 2 องค์ประกอบ คือ ส่วนแรก เทคโนโลยี Interactive เข้าทำการเปลี่ยนแปลรูปร่าง ขนาด และรูปแบบ ซึ่งมาจาก web service อุปกรณ์ sensor ผ่านคอมพิวเตอร์ และมือถือ เป็นผสมผสานระหว่างระบบดิจิทัลและแอนนาล๊อกเข้าด้วยกัน ผ่านปุ่ม สไลด์เดอร์ หรือสวิทซ์ เพื่อการควบคุมในส่วนควบคุมทั้งหมด ที่เรียกว่า Control panel  ส่วนที่ 2  แอพลิเคชั่นที่ทำงานแบบ Real Time Application ถูกออกแบบในแนวคิดหลักของเทคโนโลยี Real Time  อ้างอิง https://interactiveimmersive.io/blog/beginner/02-interactive-technology/ เทคโนโลยีเชิงโต้ตอบที่เน้นการสร้างต้นแบบที่เร็วขึ้น มีประโยชน์อย่างมากในแอปพลิเคชันและประสบการณ์การสร้างต้นแบบ  ประเภทของเทคโนโลยี Interactive  มี 6 ประเภท 1. IoT เป็นแนวคิดจะเปลี่ยนบริการทุกบริการให้อยู่บนเครือข่ายอินเทอร์เน็ต และสามารถเชื่อมต่อเข้ากับแอพลิเคชั่นทุกแอ...