https://vdo.ninja/
cài máy chủ turn
https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
https://ourcodeworld.com/articles/read/1175/how-to-create-and-configure-your-own-stun-turn-server-with-coturn-in-ubuntu-18-04
sudo apt-get -y update
sudo apt-get install coturn
systemctl stop coturn
sudo nano /etc/default/coturn
sudo nano /etc/turnserver.conf
sudo systemctl restart coturn
systemctl status coturn
sudo ss -tuln | grep :3480
=================================
gở bỏ coturn
sudo systemctl stop coturn
sudo systemctl disable coturn
sudo apt-get remove coturn
sudo apt-get purge coturn
sudo apt-get autoremove
kiểm tra coturn có chạy không
https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
cấu hình máy chủ turn trên trang index.html
<script>
// Chuyển hướng từ www.obs.ninja và www.vdo.ninja đến obs.ninja và vdo.ninja
if (window.location.hostname.indexOf("www.obs.ninja") === 0) {
window.location = window.location.href.replace("www.obs.ninja", "obs.ninja");
} else if (window.location.hostname.indexOf("www.vdo.ninja") === 0) {
window.location = window.location.href.replace("www.vdo.ninja", "vdo.ninja");
} else if (("isSecureContext" in window) && (window.isSecureContext === false)) {
console.error("This site must be run in a secure context; please ensure all links, iframes, and parent windows are using SSL");
}
var session = WebRTC.Media; // session is a required global variable if configuring manually. Run before loading main.js but after webrtc.js.
session.version = "23.4";
session.streamID = session.generateStreamID(); // randomly generates a streamID for this session. You can set your own programmatically if needed
session.defaultPassword = "someEncryptionKey123"; // Change this password if self-deploying for added security/privacy
// session.salt = location.hostname; // used only if password is not == False. You can change to "session.salt = location.hostname+location.pathname;" for greater deployment isolation
// Cấu hình TURN server
session.configuration = {
iceServers: [
{
urls: ["turn:27.74.246.165:3480"],
username: "trungdungmedia",
credential: "0902577267"
},
{
urls: ["stun:stun.trungdungmedia.com:3480"]
}
],
sdpSemantics: 'unified-plan'
};
</script>
cấu hình coturn
listening-port=3480
tls-listening-port=5432
fingerprint
lt-cred-mech
server-name=trungdungmedia.com
realm=trungdungmedia.com
user=trungdungmedia:0902577267
total-quota=100
stale-nonce=600
cert=/etc/letsencrypt/live/trungdungmedia.com/fullchain.pem
pkey=/etc/letsencrypt/live/trungdungmedia.com/privkey.pem
cipher-list="ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384"
proc-user=turnserver
proc-group=turnserver
external-ip=27.74.246.165
listening-ip=192.168.14.1xx
tham số máy gửi
?push=01&quality=0&maxframerate=30&width=1920&height=1080
tham số máy nhận
?view=01&videobitrate=6000&codec=av1&scale=100