0

I am new to this !

I am working for a chat application which requires text+ video chats. I explored Socket.io initially and found it very handy to develop text based chatting application (WEB).

While exploring the Video chat element i came across WebRTC -RTCDataChannel for sending out arbitrary data across connected peers.

My Chat Server( preferably NodeJS ) will be serving the connections for peers, along with saving text chat history.

Confusion:

Should I use Socket.io-MyChatServer as the Signalling server also? [Possible?] , Or

Should I use RTCDataChannel for signalling server? , Or

Simply forget Socket.io and consider WebRTC for both !

Thanks in advance :)

Rohit Khanna
  • 693
  • 5
  • 15
  • 1
    signaling is required and you cannot use the data channels for signaling as you need to establish some kind of communication between peers before using webrtc. You can use node with socket.io, signalr, websocket .. – G-Man Mar 04 '18 at 22:35

1 Answers1

1

Well WebRTC data channels and web sockets are different and complementary concepts in the case of peer connections.

In order to open a data channel you first need a P2P connection. In order to establish a P2P connection, you need a signaling server. So, sockets are used for that purpose, to exchange the metadata necessary to create a P2P connection. First, through sockets you establish a peer to peer connection and only after that you can use data channels.

As for using the same chat server as signaling server is up to you. WebRTC let the signaling server architecture be defined by the developer. It's a blackbox.

So, no you can't use data channels as signaling, as you can see.

Keyne Viana
  • 6,194
  • 2
  • 24
  • 55