According to nestjs, we obey event-data format and transfer by json
{
"event": "EVENT NAME",
"data": { "SOME": "DATA" }
}
After login, send this to server
{
"event": "online",
"data": {
"token": "jwt token",
"role": "teacher (or student)"
}
}
All events are sent by server
Event | Description | Data |
---|---|---|
logout | duplicate login or deleted by admin | / |
connect-request | teacher want to connect this student | { requestId: string, teacherName: string } |
message | message sent by teacher | { messageId: number, message: string, teacherName: string, tts: number, closeDelay: number } |
teacher-disconnect | disconnect by teacher (or admin) | { teacherId: string } |
teacher-connect-by-admin | connect teacher by admin forcibly | { teacherId: string, teacherName: string } |
close-message | close message by teacher | { messageId: number } |
teacher-name-changed | / | { teacherId: string, newName: string } |
Event | Description | Data |
---|---|---|
reject-connect-request | student reject connect | { requestId: string } |
accept-connect-request | student accept connect | { requestId: string } |
student-online | / | { studentId: string } |
student-offline | / | { studentId: string } |
message-close | close the message | { messageId: number, studentId: string } |
student-connect-by-admin | connect student by admin forcibly | { studentId: string, remark: string, online: boolean } |
student-disconnect-by-admin | disconnect student by admin forcibly | { studentId: string } |
logout | deleted by admin | / |