createVirtualSocket
constcreateVirtualSocket:any=addon.createVirtualSocket
Defined in: index.cts:534
Creates a virtual socket that points to an actual WebSocket connection. Virtual sockets can be subscribed to channels, and messages will be relayed to the underlying actual socket. This allows for convenient bulk unsubscription by deleting the virtual socket. Virtual sockets can also point to other virtual sockets, creating a chain that resolves to an actual socket.
socketId
The identifier of the actual WebSocket connection or another virtual socket to point to.
userPrefix
Optional user prefix (up to 15 bytes) that will be prepended to all messages sent to this virtual socket (possibly through a channel). For text messages, this prefix is assumed to be valid UTF-8.
Returns
Section titled “Returns”The unique identifier of the newly created virtual socket, which can be used just like another socket.