Module PocketMeshPeer.InitConfig

Initial configuration of the library that is passed into the init function.

let defaultSignalServerUrl: string;

Default signal server (probably localhost:7777) that is used if no signal server is specified in make.

let defaultGroupAlias: string;
type iceCredentials = {
username: string,
credential: string,
type iceServer =
| Basic(string)

Basic(url) represents ICE server at URL url with no auth.

| WithCredentials(string, iceCredentials)

WithCredentials(url, iceCredentials) represents ICE server at URL url with specified credentials.


Type representing one ICE server connection parameters.

type t = {
defaultGroupAlias: string,

Alias for the group that is automatically created on the first start.

contentInitializer: Crdt.t => Crdt.t,

Function that is used to initialize content of a newly created group.

signalServerUrl: string,

Default URL address of a WebSocket signal server.

iceServers: list(iceServer),

List of ICE servers (STUN, TURN, ...)

let make: ?⁠contentInitializer:(Crdt.t => Crdt.t) => ?⁠signalServerUrl:string => ?⁠defaultGroupAlias:string => ?⁠iceServers:list(iceServer) => unit => t;

Creates a new configuration. See t for description of the fields. If contentInitializer is missing, content of a newly created groups is left empty. If signalServerUrl is missing, default server specified in defaultSignalServerUrl constant is used. If defaultGroupAlias is not specified, "My group" is used.