|
30 | 30 |
|
31 | 31 | - Select the `Socket.IO` option and set URL to `http://localhost:3005`. Click `Connect`.
|
32 | 32 |
|
33 |
| -  |
| 33 | +  |
34 | 34 |
|
35 | 35 | - Add the following events in the `Events` tab and listen to them.
|
36 | 36 |
|
37 |
| -  |
| 37 | +  |
38 | 38 |
|
39 |
| - - To send a message, go to the `Message` tab and ensure that your message is being parsed as `JSON`. |
| 39 | + - Add a valid JWT token in the `Authorization` header. |
40 | 40 |
|
41 |
| -  |
| 41 | +  |
42 | 42 |
|
43 | 43 | - In the `Event name` input, input the correct event name. Click on `Send` to send a message.
|
44 | 44 |
|
45 |
| -  |
| 45 | +  |
| 46 | + |
| 47 | + - To send a message, go to the `Message` tab and ensure that your message is being parsed as `JSON`. |
| 48 | + |
| 49 | +  |
46 | 50 |
|
47 | 51 | ## Events Available
|
48 | 52 |
|
49 | 53 | | Event Name | Description | Parameters | Response Event |
|
50 | 54 | | --------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
51 | 55 | | **join** | Joins a communication rooms | `roomId` (string): ID of the room. <br> `username` (string): Username of the user that joined. | **user_joined**: Notify the other user that a new user has joined the room. |
|
52 | 56 | | **send_text_message** | Sends a message to the other user | `roomId` (string): ID of the room. <br> `message` (string): Message to send. <br> `username` (string): User that sent the message. <br> `createdTime` (number): Time that the user sent the message. | **text_message_received**: Notify the user that a message is sent |
|
53 |
| -| **leave** | Leaves the communication room. | `roomId` (string): ID of the room to leave. <br> `username` (string): User that wants to leave. | **user_left**: To notify the user when one user leaves. | |
| 57 | +| **user_disconnect** | User disconnection. | None | **user_left**: To notify the user when one user leaves. | |
54 | 58 | | **disconnect** | Disconnects from the server. | None | **disconnected**: To notify the user when one user gets disconnected from the server. |
|
0 commit comments