You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/websocket-guide.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ While Websockets support multi-user sessions, this documentation is mainly focus
23
23
24
24
## Why Websockets?
25
25
26
-
Web applications sessions are not persistent. You can maintain state at the back- _or_ frontend, but not both simultaneously. It's great that `Nuxt Pinia` allows your browser to store what you've been doing, but that will need to be communicated via your API to the backend on every page change.
26
+
Web applications sessions are not persistent. You can maintain state at the back- _or_ frontend, but not both simultaneously. It's great that `React Redux` allows your browser to store what you've been doing, but that will need to be communicated via your API to the backend on every page change.
27
27
28
28
There are ways around this, such as automatically polling the API (known as [long polling](https://ably.com/topic/long-polling)), but Websockets create a bidirectional session between the front- and backends, allowing you to run a synchronous interactive process.
29
29
@@ -42,7 +42,7 @@ The following general conditions apply:
42
42
43
43
Here's how the workflow tends to play out:
44
44
45
-
-`frontend` - initialise a socket by opening a session and sending an initial payload `request`, which may include a user token (if authentication is required).
45
+
-`frontend` - initialize a socket by opening a session and sending an initial payload `request`, which may include a user token (if authentication is required).
46
46
-`backend` - receive a socket `request`, validate the session (user or other), send a `response` to the `frontend`, and then enter a `while True` loop to keep the session open and keep listening for `requests`.
47
47
-`frontend` - each `response` triggers an event, updating the view.
48
48
-`frontend` - send an instruction to close the socket when the user ends the sessions or, as fallback, when the user changes the page.
@@ -64,7 +64,7 @@ pip install websockets
64
64
yarn install websocket-as-promised
65
65
```
66
66
67
-
## Setting up the Nuxt`frontend`
67
+
## Setting up the React`frontend`
68
68
69
69
The API `backend` is reached at `ws://localhost/api/v1` (or `wss://<your-domain>/api/v1` in production).
0 commit comments