ilusm.dev

wssrv

WebSocket server, rooms, broadcasting.

Load with: use wssrv

Quick example

use wssrv

result = wsnew("value")
prn(result)

Functions

WebSocket server

wsnew(srv)

Performs the operation. Takes srv.

wsonc(ws, h)

Performs the operation. Takes ws, h.

wsond(ws, h)

Performs the operation. Takes ws, h.

wsonm(ws, h)

Performs the operation. Takes ws, h.

Client management

wssta(ws)

Performs the operation. Takes ws.

wsrdl(ws, cl)

Deletes an item. Takes ws, cl.

wsdis(ws, cl)

Returns true/false based on a condition. Takes ws, cl.

Message sending

wssen(cl, d)

Encodes. Takes cl, d.

wssen1(cl, d)

Performs the operation. Takes cl, d.

Broadcasting

wsbc(ws, d, ex)

Performs the operation. Takes ws, d, ex.

wsbcj(ws, d, ex)

Performs the operation. Takes ws, d, ex.

Rooms

wsjoi(ws, r, cl)

Performs the operation. Takes ws, r, cl.

wslea(ws, r, cl)

Performs the operation. Takes ws, r, cl.

wsrds(ws, r, d, ex)

Performs the operation. Takes ws, r, d, ex.

wsrdj(ws, r, d, ex)

Performs the operation. Takes ws, r, d, ex.

wsrdc(ws, r)

Performs the operation. Takes ws, r.

Ping/Pong

wspin(cl)

Initialises. Takes cl.

Connection info

wsclc(ws)

Performs the operation. Takes ws.

wscld(cl)

Performs the operation. Takes cl.

wscls(cl, k, v)

Lists items. Takes cl, k, v.

Close

wscls1(ws, c, r)

Performs the operation. Takes ws, c, r.

Presence/Online status

wspre(ws)

Performs the operation. Takes ws.

wspre1(ws, cl, st)

Performs the operation. Takes ws, cl, st.

wspre2(ws, cl)

Performs the operation. Takes ws, cl.

wspre3(ws, cl, st)

Performs the operation. Takes ws, cl, st.

Typing indicators

wstyp(ws, cl, r)

Performs the operation. Takes ws, cl, r.

wstyp1(ws, cl, r)

Performs the operation. Takes ws, cl, r.

Binary messages

wssen2(cl, d)

Performs the operation. Takes cl, d.

wsbcb(ws, d, ex)

Performs the operation. Takes ws, d, ex.

Message acknowledgement

wsack(ws, cl, id)

Performs the operation. Takes ws, cl, id.

Rate limiting per client

wsrl(ws, cl, max)

Performs the operation. Takes ws, cl, max.

Message history

wsrdh(ws, r, lim)

Performs the operation. Takes ws, r, lim.

wsrds1(ws, r, msg)

Performs the operation. Takes ws, r, msg.

Private/Direct messaging

wspri(ws, from, to, msg)

Performs the operation. Takes ws, from, to, msg.

Graceful shutdown

wsshu(ws, tmo)

Performs the operation. Takes ws, tmo.

Notes

  • WebSocket server - upgrade HTTP connections, broadcast, rooms.