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
After running the above command, open your browser on http://localhost:3000 to see an example of usage.
51
+
Open your browser on http://localhost:3000 to see an example of usage.
51
52
52
53
### Runtime configuration
53
54
54
55
The sample config file provided in the [sample-env](https://github.com/diogob/postgres-websockets/tree/master/sample-env) file has a jwt secret just for testing and is used in the [sample client]((https://github.com/diogob/postgres-websockets/tree/master/client-example)).
55
56
56
-
## Opening connections
57
-
58
-
To open a websocket connection to the server, there are two possible request formats:
59
-
60
-
1. Requesting a channel and giving a token
57
+
## Opening a connection to one channel with a token
61
58
62
59
When you request access to a channel called `chat` the address of the websockets will look like:
63
60
```
@@ -69,7 +66,7 @@ The token on the URL above has no `channels` claim, therefore is can be used to
69
66
When the token contains a `channels` claim, the value of that claim should be a list of allowed channels.
70
67
Any requested channel not set in that claim will result in an error opening the connection.
71
68
72
-
2. Giving only the token
69
+
## Connecting to multiple channels
73
70
74
71
When you inform only the token on the websocket address, the `channels` claim must be present.
75
72
In this case, all channels present in the claim will be available simultaneously in the same connection.
0 commit comments