PieSocket logo

Overview

PieSocket lets you integrate dynamics into your application by enabling two-way communications with its Websocket channels.

How to use

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.

Websocket Endpoint

{primary} wss://connect.websocket.in/v3/CHANNEL_ID?api_key=API_KEY

Replace CHANNEL_ID (it can be any positive integer) and API_KEY with your own and you are ready to connect. You can get your API key here

Parameters

API Key

You can generate an API Keys from your PieSocket account for free.

Channel ID

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://connect.websocket.in/v3/1/1998?apiKey=hidden
-  wss://connect.websocket.in/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.

Notify Self

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 &notify_self to your server connection URL as shown below.

wss://connect.websocket.in/v3/CHANNEL_ID?api_key=API_KEY&notify_self

Getting started

See to our getting started guide for examples on how to use the service.