WSS Routing Reference December 10, 2021

View all articles from Gyroscope Development Blog

The following is a RAW message routing scheme for the new Web Socket Server / Chat Server:

Redis Channels

When an object is pushed to the following Redis queues, it is first picked up by the WSS Broker, and then translated to a Message Type that's further delivered by the WSS Monitor.

The Broker loops through all the Redis queues, or "channels" in one loop before taking a 300ms break.

Note that unless a message is denoted as "as-is", a recomputed version is sent to the web socket client.

actions -> msg.2 (without the "userid" field, or with "userid":0)

{type:update, sid:$wssid, rectype:$rectype, recid:$recid, gsid:$gsid, extra: $extra}

actions -> msg.4 (with a non-zero "userid" field)

{type:update, sid:$wssid, rectype:$rectype, recid:$recid, gsid:$gsid, userid:$userid, extra: $extra}

allactions -> msg.3

{type:update, rectype:$rectype, extra: $extra}

chatbroadcasts -> msg.6


chatalerts -> msg.7 (target=client)

{type:message, maxmsgid:$maxmsgid}

chatalerts -> msg.7 (target=client, alerttype=setagent)


chatalerts -> msg.2 (target=agent, without agentid)


chatalerts -> msg.4 (target=agent, with agentid)

{type:chat, chatid:$chatid, maxmsgid:$maxmsgid, fromagentid: $senderid}

Monitor Message Types

The WSS Monitor routine processes both internal messages and the messages from the Broker. Broker messages (msg) are divided into subtypes.

- reg (when a client connects)

- dereg (when a client disconnects)

- msg (Broker-forwarded message)

msg.0 - single device/SID
msg.1 - all devices (unused)
msg.2 - all GS users within a GS
msg.3 - all GS users
msg.4 - specific GS user
msg.5 - all chat clients (unused)
msg.6 - all chat clients within a GS
msg.7 - specific chat client
msg.8 - agent change broadcast

- knocker (20-sec keep-alive)

Authentication Types

Internal (Gyroscope) users and chat clients are authenticated differently.

- WSS***-###-###=
- GSC###-***-###=

Chat Session Manager Subtypes:

- guest sessions
- portal
- partially verified
- fully verified

Our Services

Targeted Crawlers

Crawlers for content extraction, restoration and competitive intelligence gathering.

Learn More

Gyroscope™ ERP Solutions

Fully integrated enterprise solutions for rapid and steady growth.

Learn More


Self-updating websites with product catalog and payment processing.

Learn More