Comments on: WebRTC vs WebSockets https://bloggeek.me/webrtc-vs-websockets/ The leading authority on WebRTC Mon, 29 Nov 2021 06:36:04 +0000 hourly 1 By: Tsahi Levent-Levi https://bloggeek.me/webrtc-vs-websockets/#comment-142396 Mon, 29 Nov 2021 06:36:04 +0000 https://bloggeek.me/?p=13381#comment-142396 In reply to R Barman.

To send data over WebRTC’s data channel you first need to open a WebRTC connection. You do that (usually) by opening and using a WebSocket.

So I ask you this – if you already spent the time, effort and energy to open that WebSocket and send data over it – does your use case truly needs the benefits of WebRTC’s data channel? If the answer is yes (truly yes) then go do it. Otherwise, just stick with your WebSocket.

]]>
By: R Barman https://bloggeek.me/webrtc-vs-websockets/#comment-142350 Sat, 27 Nov 2021 08:18:34 +0000 https://bloggeek.me/?p=13381#comment-142350 So basically when we want an intermediary server in the middle of the 2 clinets we use websockets or else webrtc. And as far as I know we only need a server in the middle if we want to make the chat permanent by storing it in the database, and we dont want it to be permanent then we could use webrtc as it doesnt involve a server in the middle (and this server would encur extra costs and latency) alse webrtc uses udp being lighter than tcp will make it even faster

]]>
By: Tsahi Levent-Levi https://bloggeek.me/webrtc-vs-websockets/#comment-137647 Wed, 13 Oct 2021 18:36:08 +0000 https://bloggeek.me/?p=13381#comment-137647 In reply to Salvador Pedraza.

Salvador,

Yes. That’s where a WebRTC data channel would shine.
I wouldn’t view this as a WebSocket replacement simply because WebSocket won’t be a viable alternative here (at least not directly).

]]>
By: Salvador Pedraza https://bloggeek.me/webrtc-vs-websockets/#comment-137638 Wed, 13 Oct 2021 16:52:32 +0000 https://bloggeek.me/?p=13381#comment-137638 Hi,

Thanks for the post.
Does it makes sense to use WebRTC a replacement of WebSocket when server is behind a NAT and you dont want the user to touch the router?
Imagine a use case where you have many embedded devices distributed in many customers (typically behind a NAT).
E.g. a security camera. You want to give remote control through web (on mobile) to the devices.
The device act as server of data. But a peer of a WebRTC connection to the user browser.
Does it makes sense use WebRTC here to traverse the NAT?
Thanks.

]]>
By: LastHumansGarage https://bloggeek.me/webrtc-vs-websockets/#comment-123857 Mon, 19 Oct 2020 11:40:48 +0000 https://bloggeek.me/?p=13381#comment-123857 thanks for the page, it helped clarify things for me.

]]>
By: Tsahi Levent-Levi https://bloggeek.me/webrtc-vs-websockets/#comment-122573 Tue, 07 Jul 2020 12:30:02 +0000 https://bloggeek.me/?p=13381#comment-122573 In reply to Ion Stefanache.

Not sure I follow…

]]>
By: Ion Stefanache https://bloggeek.me/webrtc-vs-websockets/#comment-122571 Tue, 07 Jul 2020 12:01:20 +0000 https://bloggeek.me/?p=13381#comment-122571 Hi,
Recently I seen one tutorial for ESP32+OV7670 which send video data to smartPhone or other mobile device using websocket.
Seem that in this case websocket can be used instead of webrtc?!
Thnaks

]]>
By: Tsahi Levent-Levi https://bloggeek.me/webrtc-vs-websockets/#comment-121867 Wed, 27 May 2020 16:47:53 +0000 https://bloggeek.me/?p=13381#comment-121867 In reply to bernd.

Bernd, not sure I understand the questions… can you be more specific, or more descriptive please?

]]>
By: bernd https://bloggeek.me/webrtc-vs-websockets/#comment-121864 Wed, 27 May 2020 15:37:52 +0000 https://bloggeek.me/?p=13381#comment-121864 How does it works with 2way streaming ..
interactive streams
Open And close functions ..??

]]>
By: Tsahi Levent-Levi https://bloggeek.me/webrtc-vs-websockets/#comment-120817 Tue, 10 Mar 2020 05:24:34 +0000 https://bloggeek.me/?p=13381#comment-120817 In reply to Ariel.

They are both packet based in the sense that they packetize the messages sent through them (WebSockets and WebRTC’s data channel).

UDP isn’t really packet based. It sends out datagrams, which are then paketized per datagram (or something similar).

WebSockets and WebRTC are of a higher level abstraction than UDP. Whatever they use under the hood shouldn’t concern you much since the packetization of messages is something they do for you (with or without the help of the lower layers).

As for reliability, WebSockets are reliable. WebRTC data channels can be either reliable or unreliable, depending on your decision.

]]>