Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add liveness check to WebRTC output using data channel #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Aug 5, 2023

  1. 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. A separate thread checks which the last
    time each client responded to a ping request and initiates new pings
    for clients that have not responded in some time (half the timeout
    duration). 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 and is configurable via the cli
    option --webrtc-timeout.
    jpiccari committed Aug 5, 2023
    Configuration menu
    Copy the full SHA
    56c0cfd View commit details
    Browse the repository at this point in the history