Posts

Showing posts from August, 2019

How to make a peer-connection using webrtc

Image
designing a simple video chat application  To get a fair idea of what we are trying to build let us examine the figure We want to build a connection between two clients so that they can share their video-streams .As it is clear from the figure that we need a mediator to act as a channel between the clients.Our purpose will be solved by a server which can connect users over the internet using their IP addresses.  Let us begin with the server. The server just needs to handover whatever it receives from one user to the other. We will establish an express server. Establishing an express server is quite easy.(First, install express package locally for your project.) const express = require ( ' express ' ) const app = express () Just these two lines will establish your express app to handle API request like GET and POST. Now,we add some configuration to our express app. app . use ( express . json ()) app . use ( express . urlencoded ({ extended : true }