-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsequenceDiagram
31 lines (28 loc) · 1.24 KB
/
sequenceDiagram
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
```mermaid
sequenceDiagram
participant U as User (view in browser)
participant C as Client (1st person, bundle from :3001)
participant S as Server (express @ :3000)
participant R as Room (clients sub'd to room)
participant O as Other Users (view in browser)
U->>C: click LOGIN
C->>S: POST http://hostname:3000/login
Note right of C: Origin: http://hostname:3001<br>Sec-Fetch-Site: cross-site<br>Referrer: http://host:3001/
S->>C: 200 OK
Note left of S: Access-Control-Allow-Origin: *<br>Connection: keep-alive<br>Keep-Alive: timeout=5<br>X-Powered-By: Express<br>Date: Fri, 02 Dec 2022...
note left of S: JSON: LOGGEDIN object
U->>C: click CONNECT
C->>S: GET wss://hostname:3000/
note right of C: Upgrade: websocket<br>Connection: keep-alive, Upgrade<br>Sec-Fetch-Dest/Mode: websocket<br>Sec-WebSocket-Key: A3be...SQ==
S->>C: 101 Switching Protocols
note left of S: Connection: Upgrade<br>Sec-Websocket-Accept: AAswx...KQ=<br>Upgrade: websocket
note left of S: WS msg: UNICAST_WELCOME
S->>R: WS BCAST_ENTRY
R->>O: "system chat line user entry"
R->>O: [add user to participants list]
U->>C: enter text, click SEND
C->>U: "user's own chat line"
C->>S: SEND_CHAT
S->>R: BCAST_CHAT
R->>O: "sending user's chat line"
```