WEBRTC video conference using STUN TURN server with PEER.JS

create your own customize web conference app.

what is WEBRTC?

WebRTC is an open source project to enable realtime communication of audio, video and data in Web and native apps.

Api consist of predefined function and methods which will enable to stream the media contents.A WebRTC application will usually go through a common application flow. Accessing the media devices.It supports video, voice, and generic data to be sent between peers, allowing developers to build powerful voice- and video-communication solutions.

What is Signaling?

WebRTC uses RTCPeerConnection to communicate streaming data between browsers, but also needs a mechanism to coordinate communication and to send control messages, a process known as signaling.

if you work webrtc with Wifi and Mobile data WEBRTC must need STUN and TURN server

What is STUN and TURN server?

WebRTC is designed to work peer-to-peer, so users can connect by the most direct route possible. However, WebRTC is built to cope with real-world networking: client applications need to traverse NAT gateways and firewalls, and peer to peer networking needs fallbacks in case direct connection fails. As part of this process, the WebRTC APIs use STUN servers to get the IP address of your computer, and TURN servers to function as relay servers in case peer-to-peer communication fails.

will explain detail how to create STUN and TURN by next post

we will execute our webrtc project by using Node and Js library cool..!!

so lets jump in to the process.

step 1:

install npm dependency by running:

why we using socket.io?

which will enable communicate based on event that is allow communicate back and forth with server easily. read more about socket.io

what is uuid ?

will enable to create dynamic url

what is peer.js

will enable to establish peer to peer connection between two servers. read more about peer.js

create Server.js in your route directory after configuring npm setup.

you can mention any listen id by writing server listener.room id and user i d will be unique validate argument.

create public/script.js in route directory then add following code:

Note: port either you can use 3478 or 443.

next you can create view of your file under directory views/room.ejs

cool..!!! your basic web conference/app is here you can improve the concept layout design everything by manipulating the code.

Software developer|Entrepreneur|Science||Blockchain|Crypto