บนนำ
WebRTC ใช้สำหรับการโอนย้ายข้อมูลแบบ peer-to-peer
Coturn เป็นโอเพนซอร์สฟรี สำหับการนำไปใช้งานกับ STUN และTURN
ความต้องการของระบบ
สำหรับการติดตั้ง
1. ทำการอัฟเดล
sudo apt-get update -y2. ติดตั้อง Conturn
sudo apt-get install coturn3. แก้ไขไฟล์ conturn
sudo nano /etc/default/coturnTURNSERVER_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
////
ความคิดเห็น
แสดงความคิดเห็น