As Mles 1.0 had a strong preference to implement authentication of a client, such a mechanism will be part of Mles v2 as well with an optional auth-field.

{
	"uid":"",
	"channel":"",
	"auth":""
}

When MLES_KEY environment variable is set in the server, the auth field will be validated against SipHash over uid, channel + MLES_KEY. The auth feature will be implemented post-v2 release in case requested. siph crate can be used by clients to generate valid auth-fields.

Peering works as before on the logical protocol layer, the peer server does not need to differentiate a real client from a peer. The peering server will not send message history to new connections if it has an active connection to its peer server. The peering feature as well will be implemented post-v2 release in case requested.

An example client session between Alice and Bob with websocat looks like this:

% websocat wss://mles.io --header "Sec-WebSocket-Protocol: mles-websocket"
{ "uid":"alice", "channel":"example" }
Hello Bob!
{ "uid":"bob", "channel":"example" }
Hello Alice!