# `Membrane.WebRTC.SimpleWebSocketServer`
[🔗](https://github.com/membraneframework/membrane_webrtc_plugin/blob/v0.26.7/lib/membrane_webrtc/simple_websocket_server.ex#L1)

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
`t:Membrane.WebRTC.Signaling.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.

# `options`

```elixir
@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}`.

# `validate_options!`

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
