Here's the last code I played around with. One observation - no error message if something went wrong, the process just crashed. This would be a problem in real life, as I'd be expecting this to continuously poll.
AddExtender(`wbOmnibus.dll`)
BoxOpen(`test`,``)
zUrl=`ws://echo.websocket.events/.ws`
zBT=``
zMessages=`this is a test,this works,wow,hello`
zWs=wsConnect(zUrl)
c=0
While @TRUE
c=c+1
BoxTitle(c)
Ret=wsPoll()
While Ret!=``
zBT:=@CR:Ret
BoxText(zBT)
Ret=wsPoll()
EndWhile
r=Random(3)+1
e=ItemExtract(r,zMessages,`,`)
wsSend(c:` `:e)
TimeDelay(c)
EndWhile
wsDisConnect()