9 Commits

Author SHA1 Message Date
Kamil Trzciński
400e036ea2 webrtc: check datachannel label for ping/pong 2025-07-04 18:07:50 +02:00
Kamil Trzciński
2d3a488437 webrtc: add ping/pong when sending a frame 2025-07-03 00:07:59 +02:00
Joshua Piccari
e4fe25fdb6 webrtc: add liveness check to WebRTC output using data channel
Previously, there was no way to detect if WebRTC clients were still
connected to the stream. This lead to the RTC streams being kept
open indefinitely when clients focibly closed the stream. This can
happen with Chrome, Edge, Safari, etc when the tab is closed or on
mobile devices when the screen is locked or browser closed.

This change adds a data channel to the stream and requires users to
respond to ping requests. While sending a frame the ping might be
sent to the client. If clients do not respond to these ping requests before
the timeout duration the stream is closed and the client is removed
from the server. This causes the client to reinitiate the connection.

The timeout defaults to 30 seconds.

The client needs to send `keepAlive: true` as part of webrtc request.
On the received `ping` send back the `pong` over data-channel.
2025-07-03 00:07:59 +02:00
Zeyu Dong
afff8b9d78
html: fix syntax problem in iceServers (#77) 2023-06-26 13:46:41 +02:00
Kamil Trzcinski
01b0e969b3 webrtc: always use iceServers instead of ice_servers 2023-06-14 00:18:56 +02:00
Kamil Trzcinski
272b16ee1c webrtc: accept iceServers: [] provided in POST /webrtc, support trickle ICE
Thanks https://github.com/ayufan/camera-streamer/pull/65
2023-06-13 20:35:48 +02:00
Stefan Dej
d143f3019e
fix: use current url to connect to server (#22)
instead of using absolute path `/webrtc`

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2022-10-30 17:16:06 +01:00
MK3S+ Printer
e509c328f1 Disable usage of STUN server (it should not be needed for local) 2022-10-10 20:27:22 +02:00
Kamil Trzcinski
57fb09fbf1 Improve index.html to provide better description of all options 2022-10-03 01:25:51 +02:00