EasyRTC socket messages are sent via socket.io using three custom emit types:
"easyrtcAuth" is the socket.io emit type which EasyRTC expects to initialize (or re-initialize) a connection. No other messages are handled by EasyRTC until a connection is authenticated.
Includes fields needed for authentication. Sender and target must be online, authenticated, and in same application. Returns a message with msgType='token' upon success.
Fields:
msgData Fields:
Returns:
The easyrtcCmd is the core socket.io emit type which EasyRTC uses to send and receive commands.
Unless specified, messages sent to the server will be returned with an ack or an error.
WebRTC signal. Transfer of WebRTC ICE candidate(s) for establishing peer-connection. Sender and target must be online, authenticated, and in same application.
Fields:
WebRTC signal. Sends WebRTC offer for establishing peer-connection. Sender and target must be online, authenticated, and in same application.
Fields:
WebRTC signal. Accepts WebRTC offer for establishing peer-connection. Sender and target must be online, authenticated, and in same application.
Fields:
WebRTC signal. Rejects WebRTC offer for establishing peer-connection. Sender and target must be online, authenticated, and in same application.
Fields:
WebRTC signal. Instructs target to hangup WebRTC peer-connection. Sender and target must be online, authenticated, and in same application.
Fields:
Requests a refreshed ICE configuration. This gives the ability to update STUN and TURN servers listing on a periodic basis for longer running connections.
Fields:
Returns: - iceConfig - error
Requests a list of all rooms which the client has access to. It has no fields. The server should return a message to the callback with msgType of 'roomList'.
Fields:
Returns: - roomList - error
Enters a room. If room doesn't exist, a new room may be created.
Fields:
msgData Fields:
Returns:
- roomData (with roomStatus of join)
- error
Leaves a room. Upon leaving a room, the API should remove all room info (incl. connection list) from memory.
Fields:
msgData Fields:
Returns:
- roomData (with roomStatus of leave)
- error
Sets the apiField value for a connection. This apiField is sent to all other connections in the roomData. It is important to realize that this field is not unique to a room. Upon receiving an empty string, the field is removed.
Fields: - msgData (required)
msgData Fields:
Returns:
- roomData (with roomStatus of update)
- error
Sets user online presence which is re-broadcast as part of the list. User must be authenticated.
Fields:
msgData Fields:
away|chat|dnd|xa]Returns:
- roomData (with roomStatus of update)
- error
Sets user configurable options. User must be authenticated.
Fields:
msgData Fields:
null.null.Transfer of WebRTC ICE candidate(s) for establishing peer-connection. Sender and target must be online, authenticated, and in same application.
Fields:
Sends WebRTC offer for establishing peer-connection. Sender and target must be online, authenticated, and in same application.
Fields:
Accepts WebRTC offer for establishing peer-connection. Sender and target must be online, authenticated, and in same application.
Fields:
Rejects WebRTC offer for establishing peer-connection. Sender and target must be online, authenticated, and in same application.
Fields:
Instructs target to hangup WebRTC peer-connection. Sender and target must be online, authenticated, and in same application.
Fields:
ICE configuration object. This gives the ability to update the STUN and TURN server listing on a periodic basis for longer running connections. Upon reception, the client should refresh
Fields:
- iceConfig
- iceServers (array of objects)
- url (required) Format is ((stun|turn):ADDRESS:[PORT][?transport=tcp])
- username (optional) May be used by TURN servers
- credential (optional) May be used by TURN servers
Returns: - iceConfig - error
Initiates an authenticated EasyRTC application. Note this may be sent multiple times in a session upon configuration changes. The API should reset application, room, and list data.
Fields:
msgData Fields:
Provides room information for all rooms the user is currently in. This includes a list of online users who the user is permitted to see. By default authenticated users can see all other users in the same application and room.
Fields:
msgData Fields:
- roomData (required) Map of room names
- roomName (required) Room name (matches map key)
- roomStatus (required) Instruction to API as to whether to join, update, or leave a given room. [join|update|leave]
- join - Client is considered to be joined to the given room. clientList field will may be present to show other users who are visible in the room.
- update - Client should update what it knows about the room. field or clientList or clientListDelta field may be present.
- leave - Client is considered to have left the room, and should delete everything it knows about the room including the ids of other users.
- clientList (optional) Map of easyrtcid's for users online in the same room. If present, this should overrule the current list in memory.
- easyrtcid (required) Matches map key
- username (optional)
- roomJoinTime (required) Timestamp of when client joined room
- presence (required) {show:[away|chat|dnd|xa],status:{String}}
- apiField (optional) Map of appDefinedFields and their values
- browserFamily (optional)
- browserMajor (optional)
- osFamily (optional)
- deviceFamily (optional)
- clientListDelta (optional)
- updateClient (optional) Map of easyrtcids to update. Will contain same fields as 'clientList'
- removeClient (optional) Map of easyrtcids to remove from the client list.
- field (optional) - map of room fields. If this exists but is empty, than all fields should be removed.
- fieldName
- fieldValue
Provides rooms which the client has access to. By default authenticated users can see all other rooms in the same application.
Fields:
msgData Fields: - roomList (required) Map of room names - roomName (required) Room name (matches map key) - numberClients (optional) The number of clients in the room. By default this is enabled.
Provides session information for the user. This includes any session fields.
Fields:
msgData Fields: - sessionData (required) Object holding session information - easyrtcsid (required) Session identifier - field (optional) - map of room fields - fieldName - fieldValue
Instructs API to forward user to specified URL. Useful for server handled error handling and user support techniques.
Fields:
msgData Fields:
Provides an error code to the API when an error occurs.
Fields:
msgData Fields:
"easyrtcMsg" is the socket.io emit type which EasyRTC uses for custom application level messages.
Fields:
Returns:
Fields:
Returns:
Please feel free to post on our discussion forum: