-
Notifications
You must be signed in to change notification settings - Fork 1
1. Setting up a Connection
Florian König edited this page Oct 31, 2022
·
7 revisions
To connect two clients (host and attendee):
To determine yourself as host, send this message to the server:
{
"type": "connect-host"
}You will get a reply containing your id and reconnect code:
{
"type": "connected-id",
"id": "$hostId",
"reconnectCode": "$reconnectCode"
}Use the hostId to request connecting with the other client. code will be sent to the host client to verify the request.
{
"type": "connect-attendee",
"host": "$hostId",
"code": "$code"
}Once the host has accepted the request, the server will emit your id:
{
"type": "connected-id",
"id": "$clientId",
"reconnectCode": "$reconnectCode"
}Whenever an attendee client requests a connection, the host will get this message asking for approval:
{
"type": "verify-attendee-request",
"clientId": "$clientId",
"code": "$code"
}If you deem the provided code worthy, accept the request:
json { "type": "accept-attendee-request", "clientId": "$clientId" }
Otherwise, decline the request:
json { "type": "decline-attendee-request", "clientId": "$CLIENT" }