A WebSocket communication involves a WebSocket server. Mbed decided to provide a WebSocket server to allow all mbed users to deploy their WebSocket communications without the need to create their own server.
Protocol used by the server¶
The url format to establish a connection with the server is: ws://sockets.mbed.org/ws/<channel>/<mode> (Don't try and go here, it will not work, it's a websocket url)
The WebSockets are divided into channels.
There are 3 connection modes:
- wo: write-only: the user can write on a certain channel but cannot receive messages
- ro: read-only: the user can read messages on a certain channel but cannot write messages
- rw: read-write: the user can read and write messages over a channel
When the server receives a message from a client in a certain channel who is not in 'ro' mode:
- it will broadcast the message to all clients connected to this channel who are in 'rw' or 'ro' mode
If you want more information on WebSockets, please visit: