'how to send video and audio streams through sockets

I am trying to build a screen sharing app using electron js, webRTC , socket io and express.

Can please explain to me :

how can i send the MediaStream taken from the getDisplayMedia to the server through socket io … I have read articles about that and they explained that it is not possible to send it through websocket however we should use webRTCpeerConnection because the stream is live … Can you tell me more about this and i wonder if i can send video and audio tracks one by one throught web sockets if possible or if you have a solution for that using websocket instead of RTCpeerconnection . Sorry for the long message, i will appreciate your help <3



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source