View Source Membrane.WebRTC.SimpleWebSocketServer (Membrane WebRTC plugin v0.23.2)

A simple WebSocket server spawned by Membrane.WebRTC.Source and Membrane.WebRTC.Sink. It accepts a single connection and passes the messages between the client and a Membrane element.

The messages sent and received by the server are JSON-encoded Membrane.WebRTC.SignalingChannel.json_data_message/0. Additionally, the server sends a {type: "keep_alive", data: ""} messages to prevent the WebSocket from being closed.

Examples of configuring and interacting with the server can be found in the examples directory.

Summary

Types

Options for the server.

Types

options()

@type options() :: [ip: :inet.ip_address(), port: :inet.port_number()]

Options for the server.

The port is required, while the IP address defaults to {127, 0, 0, 1}.

Functions

validate_options!(options)

@spec validate_options!(options()) :: options() | no_return()