Creates an instance of RPCServer.
Optionalport: numberThe port number to listen on. If not provided, the server will operate in noServer mode.
ProtectedcallsProtectedclientsProtectedcurrentIDProtectedeventsProtectedfunctionsProtectedgroupProtectedgroupsProtectedpingProtectedsocketProtectedusersProtectedwssThe WebSocket server instance.
ProtectedcallRPCCloses the WebSocket server.
ProtectedcreateProtecteddeleteEmits an event to all members of a group.
The name of the group.
The name of the RPC method.
The parameters to be passed to the RPC method.
Returns the number of members in a group.
The name of the group.
The number of members in the group.
Forwards the upgrade request to the WebSocket server. Useful if you have an existing HTTP server and want to handle WebSocket upgrades.
Iterates over all members of a group and calls a callback function for each member.
The name of the group.
The callback function to be called for each member.
Registers an event listener.
The name of the event.
The function to be called when the event is emitted.
A SignalConnection object.
ProtectedonProtectedonRegisters a callback to be called when a group is removed.
The name of the group.
The callback function to be called when the group is removed.
ProtectedonProtectedonProtectedonRPCEventProtectedonRPCMessageProtectedonRPCResponseRegisters a listener for changes in the user's connection status.
The username to monitor for connection status changes.
A callback function that is invoked when the user's connection status changes. The callback receives a boolean parameter indicating whether the user is connected (true) or disconnected (false).
A function that can be called to remove the listener.
ProtectedpingHelper to register an authorized RPC function that requires user authentication.
The name of the RPC function.
The function to be registered.
Registers an RPC function.
The name of the RPC function.
The function to be registered.
ProtectedRegisterRegisters a JWT authentication function.
A function that takes a JWT token and returns a UserInfo object or undefined.
ProtectedsendProtectedsendProtectedsend
The
RPCServerclass extendsRPCBaseand implementsGroupEmitterto provide a WebSocket-based RPC server with group management and JWT authentication support.Template: WebSocket
The WebSocket type used by the server.