So I'm looking to build a chat app that will allow video, audio, and text. I spent some time researching into WebSocket and WebRTC to decide which to use. Since there are plenty of video and audio apps with WebRTC, this sounds like a reasonable choice. What is the difference between WebRTC and WebSocket?
And are there other things I should consider? Things like:
Due to being new WebRTC is available only on some browsers, while WebSocket seems to be in more browsers.
Scalability - WebSocket uses a centralized server for session and WebRTC is P2P.
Multiplexing/multiple chatrooms - Used in Google+ Hangouts, and I'm still viewing demo apps on how to implement.
Server - Does WebSocket need RedisSessionStore or RabbitMQ to scale across multiple machines?
WebRTC is designed for high-performance, high quality communication of video, audio and arbitrary data. In other words, for apps exactly like what you describe.
WebRTC apps need a service via which they can exchange network and media metadata, a process known as signaling. However, once signaling has taken place, video/audio/data is streamed directly between clients, avoiding the performance cost of streaming via an intermediary server.
WebSocket on the other hand is designed for bi-directional communication between client and server. It is possible to stream audio and video over WebSocket (see here for example), but the technology and APIs are not inherently designed for efficient, robust streaming in the way that WebRTC is.
As other replies have said, WebSocket can be used for signaling.
I maintain a list of WebRTC resources: strongly recommend you start by looking at the 2013 Google I/O presentation about WebRTC.