PieSocket lets you integrate dynamics into your application by enabling two-way communications with its Websocket channels.
A WebSocket connection is a long-lived HTTP connection that stays open in your browser/app/client and can received messages or events instantly. All modern browsers support WebSockets without the need of installing a third-party library.
We provide a secure WebSocket endpoint that can be used with any WebSocket client to send and receive data in realtime.
See to our getting started guide for examples on how to use the service.
{primary} wss://CLUSTER_ID.websocket.me/v3/CHANNEL_ID?api_key=API_KEY
For example, following is a demo endpoint:
wss://demo.websocket.me/v3/1?api_key=oCdCMcMPQpbvNjUIzqtvF1d2X2okWpDQj4AwARJuAgtjhzKxVEjQU6IdCjwm
Cluster ID is provided along with your API key credentials.
You can generate an API Keys from your PieSocket account for free.
It should be a positive integer between 1-100000.
When a message is sent, it is distributed only to the members of the sender's channel.
Example: Let's say you are using two WebSocket endpoints,
- wss://demo.websocket.me/v3/1/1998?apiKey=hidden
- wss://demo.websocket.me/v3/1/1999?apiKey=hidden
and, there are 5 users connected to each channel. When a user from channel 1998 sends a message, it is received by the members of the channel 1998 only.
Choosing a channel ID:
- Channel ID can be any number between 1-10000
- Change Channel ID when you want to isolate a group of users for data transmission.
- Sender of a message will not receive their own message, use `notify_self` to enable.
By default, our Websocket server does not publish a message to its original sender. For example if there are three peers A, B and C connected to your channel, messages sent by A will only by delivered to B and C.
To enable receiving self messages, add ¬ify_self
to your server connection URL as shown below.
wss://demo.websocket.me/v3/CHANNEL_ID?api_key=API_KEY¬ify_self
See to our getting started guide for examples on how to use the service.