pub async fn start_server_with_config(
port: u16,
config: Option<ServerConfig>,
) -> Result<EventStream, Error>
Expand description
A ready to use websockets server
This method is used to spawn a websockets server with just several lines of code. It accepts a port where the server will run, and the ServerConfig, which contains custom websockets configurations, and a TLS config option; in case the end-user wants to enable TLS on this server. It returns an EventStream, which is a stream that notifies all the relevant events of the websockets server, like new connected clients messages from a single client, disconnections and errors.